use of org.motechproject.security.authentication.MotechRestBasicAuthenticationEntryPoint 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);
}
}
}
Aggregations