@Override public void init(H http) throws Exception { super.init(http); OpenIDAuthenticationProvider authenticationProvider = new OpenIDAuthenticationProvider(); authenticationProvider.setAuthenticationUserDetailsService( getAuthenticationUserDetailsService(http)); authenticationProvider = postProcess(authenticationProvider); http.authenticationProvider(authenticationProvider); initDefaultLoginFilter(http); }
@Test public void testAuthenticateFailure() { OpenIDAuthenticationProvider provider = new OpenIDAuthenticationProvider(); provider.setAuthenticationUserDetailsService( new UserDetailsByNameServiceWrapper<>( new MockUserDetailsService())); Authentication preAuth = new OpenIDAuthenticationToken( OpenIDAuthenticationStatus.FAILURE, USERNAME, "", null); assertThat(preAuth.isAuthenticated()).isFalse(); try { provider.authenticate(preAuth); fail("Should throw an AuthenticationException"); } catch (BadCredentialsException expected) { assertThat("Log in failed - identity could not be verified").isEqualTo( expected.getMessage()); } }
@Override public void init(H http) throws Exception { super.init(http); OpenIDAuthenticationProvider authenticationProvider = new OpenIDAuthenticationProvider(); authenticationProvider.setAuthenticationUserDetailsService( getAuthenticationUserDetailsService(http)); authenticationProvider = postProcess(authenticationProvider); http.authenticationProvider(authenticationProvider); initDefaultLoginFilter(http); }
/** * Configures the authentication providers * * @param auth a builder * @throws Exception ex */ @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { OpenIDAuthenticationProvider openidProvider = new OpenIDAuthenticationProvider(); openidProvider.setAuthenticationUserDetailsService(new SimpleUserService()); auth.authenticationProvider(openidProvider); RememberMeAuthenticationProvider rmeProvider = new RememberMeAuthenticationProvider(Config.APP_SECRET_KEY); auth.authenticationProvider(rmeProvider); }
@Override public void init(H http) throws Exception { super.init(http); OpenIDAuthenticationProvider authenticationProvider = new OpenIDAuthenticationProvider(); authenticationProvider.setAuthenticationUserDetailsService( getAuthenticationUserDetailsService(http)); authenticationProvider = postProcess(authenticationProvider); http.authenticationProvider(authenticationProvider); initDefaultLoginFilter(http); }
@Override public void init(H http) throws Exception { super.init(http); OpenIDAuthenticationProvider authenticationProvider = new OpenIDAuthenticationProvider(); authenticationProvider.setAuthenticationUserDetailsService(getAuthenticationUserDetailsService(http)); authenticationProvider = postProcess(authenticationProvider); http.authenticationProvider(authenticationProvider); initDefaultLoginFilter(http); }
/** * Configures the authentication providers. * * @param auth a builder * @throws Exception ex */ @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { OpenIDAuthenticationProvider openidProvider = new OpenIDAuthenticationProvider(); openidProvider.setAuthenticationUserDetailsService(new SimpleUserService()); auth.authenticationProvider(openidProvider); RememberMeAuthenticationProvider rmeProvider = new RememberMeAuthenticationProvider(Config.APP_SECRET_KEY); auth.authenticationProvider(rmeProvider); JWTAuthenticationProvider jwtProvider = new JWTAuthenticationProvider(); auth.authenticationProvider(jwtProvider); LDAPAuthenticationProvider ldapProvider = new LDAPAuthenticationProvider(); auth.authenticationProvider(ldapProvider); }
/** * Configures the authentication providers. * * @param auth a builder * @throws Exception ex */ @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { OpenIDAuthenticationProvider openidProvider = new OpenIDAuthenticationProvider(); openidProvider.setAuthenticationUserDetailsService(new SimpleUserService()); auth.authenticationProvider(openidProvider); RememberMeAuthenticationProvider rmeProvider = new RememberMeAuthenticationProvider(Config.APP_SECRET_KEY); auth.authenticationProvider(rmeProvider); JWTAuthenticationProvider jwtProvider = new JWTAuthenticationProvider(); auth.authenticationProvider(jwtProvider); LDAPAuthenticationProvider ldapProvider = new LDAPAuthenticationProvider(); auth.authenticationProvider(ldapProvider); }