/** * Creates a new instance * @see HttpSecurity#formLogin() */ public FormLoginConfigurer() { super(new UsernamePasswordAuthenticationFilter(), null); usernameParameter("username"); passwordParameter("password"); }
/** * Creates a new instance * @see HttpSecurity#formLogin() */ public FormLoginConfigurer() { super(new UsernamePasswordAuthenticationFilter(), null); usernameParameter("username"); passwordParameter("password"); }
UsernamePasswordAuthenticationFilter authenticationFilter = new UsernamePasswordAuthenticationFilter(); authenticationFilter.setAuthenticationSuccessHandler(successHandler());
@Bean public UsernamePasswordAuthenticationFilter filter() { UsernamePasswordAuthenticationFilter filter = new UsernamePasswordAuthenticationFilter(); filter.setAuthenticationManager(providerManager()); return filter; }
@Bean public ProviderManager providerManager() { List<AuthenticationProvider> list = new ArrayList<AuthenticationProvider>(); list.add(daoAuthenticationProvider()); return new ProviderManager(list); } //If you use this filter (I think so, because you've defined 'username' and 'password' in 'configure' method) @Bean public UsernamePasswordAuthenticationFilter filter() { UsernamePasswordAuthenticationFilter filter = new UsernamePasswordAuthenticationFilter(); filter.setAuthenticationManager(providerManager()); return filter; }
public MobileAwareFormLoginConfigurer(MobileAppChecker mobileAppChecker) { super(new UsernamePasswordAuthenticationFilter(), null, mobileAppChecker); usernameParameter("username"); passwordParameter("password"); }
/** * Creates a new instance * @see HttpSecurity#formLogin() */ public FormLoginConfigurer() { super(new UsernamePasswordAuthenticationFilter(), null); usernameParameter("username"); passwordParameter("password"); }
@Override protected void configure(HttpSecurity http) throws Exception { if (ShepherConstants.LOGIN_TYPE_LDAP.equals(loginType.toUpperCase())) { http.csrf().disable() .authorizeRequests() .anyRequest() .fullyAuthenticated() .and() .formLogin(); } else if (ShepherConstants.LOGIN_TYPE_CAS.equals(loginType.toUpperCase())) { http.csrf().disable().addFilter(new UsernamePasswordAuthenticationFilter()) .addFilterBefore(casAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class) .addFilterAfter(getCas20ProxyReceivingTicketValidationFilter(), AuthenticationFilter.class); } else if (ShepherConstants.LOGIN_TYPE_DEMO.equals(loginType.toUpperCase())) { http.csrf().disable() .authorizeRequests() .anyRequest().hasRole("USER") .and() .formLogin() .loginPage("/login") .passwordParameter("password") .usernameParameter("username") .permitAll() .and() .logout() .permitAll(); } }
public UsernamePasswordAuthenticationFilter usernamePasswordAuthenticationFilter() throws Exception { UsernamePasswordAuthenticationFilter usernamePasswordAuthenticationFilter = new UsernamePasswordAuthenticationFilter(); usernamePasswordAuthenticationFilter .setAuthenticationManager(authenticationManager());