// SAML Authentication Provider responsible for validating of received SAML // messages @Bean public SAMLAuthenticationProvider samlAuthenticationProvider() { SAMLAuthenticationProvider samlAuthenticationProvider = new SAMLAuthenticationProvider(); samlAuthenticationProvider.setUserDetails(samlUserDetailsServiceImpl); samlAuthenticationProvider.setForcePrincipalAsString(false); return samlAuthenticationProvider; }
/** Make sure we can get a valid SAMLAuthenticationProvider. */ @Test public void canGetSAMLAuthenticationProvider() { final SAMLUserDetailsServiceImpl service = Mockito.mock(SAMLUserDetailsServiceImpl.class); final SAMLAuthenticationProvider provider = this.config.samlAuthenticationProvider(service); Assert.assertNotNull(provider); Assert.assertThat(provider.getUserDetails(), Matchers.is(service)); Assert.assertFalse(provider.isForcePrincipalAsString()); }