use of org.springframework.security.web.authentication.www.BasicAuthenticationFilter in project motech by motech.
the class SecurityRuleBuilder method addAuthenticationFilters.
private void addAuthenticationFilters(List<Filter> filters, MotechURLSecurityRule securityRule) {
List<Scheme> supportedSchemes = securityRule.getSupportedSchemes();
if (securityRule.isRest()) {
if (supportedSchemes.contains(Scheme.BASIC)) {
MotechRestBasicAuthenticationEntryPoint restAuthPoint = new MotechRestBasicAuthenticationEntryPoint(settingsFacade);
BasicAuthenticationFilter basicAuthFilter = new BasicAuthenticationFilter(authenticationManager, restAuthPoint);
filters.add(basicAuthFilter);
}
} else {
if (supportedSchemes.contains(Scheme.USERNAME_PASSWORD)) {
filters.add(usernamePasswordAuthenticationFilter);
}
if (supportedSchemes.contains(Scheme.OPEN_ID)) {
filters.add(openIDAuthenticationFilter);
}
}
}
use of org.springframework.security.web.authentication.www.BasicAuthenticationFilter in project spring-security by spring-projects.
the class HttpBasicConfigurer method configure.
@Override
public void configure(B http) {
AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class);
BasicAuthenticationFilter basicAuthenticationFilter = new BasicAuthenticationFilter(authenticationManager, this.authenticationEntryPoint);
if (this.authenticationDetailsSource != null) {
basicAuthenticationFilter.setAuthenticationDetailsSource(this.authenticationDetailsSource);
}
RememberMeServices rememberMeServices = http.getSharedObject(RememberMeServices.class);
if (rememberMeServices != null) {
basicAuthenticationFilter.setRememberMeServices(rememberMeServices);
}
basicAuthenticationFilter = postProcess(basicAuthenticationFilter);
http.addFilter(basicAuthenticationFilter);
}
Aggregations