use of com.evolveum.midpoint.authentication.impl.provider.PasswordProvider in project midpoint by Evolveum.
the class HttpHeaderModuleFactory method createModuleFilter.
@Override
public AuthModule createModuleFilter(AbstractAuthenticationModuleType moduleType, String sequenceSuffix, ServletRequest request, Map<Class<?>, Object> sharedObjects, AuthenticationModulesType authenticationsPolicy, CredentialsPolicyType credentialPolicy, AuthenticationChannel authenticationChannel) throws Exception {
if (!(moduleType instanceof HttpHeaderAuthenticationModuleType)) {
LOGGER.error("This factory support only HttpHeaderAuthenticationModuleType, but modelType is " + moduleType);
return null;
}
isSupportedChannel(authenticationChannel);
HttpHeaderAuthenticationModuleType httpModuleType = (HttpHeaderAuthenticationModuleType) moduleType;
HttpHeaderModuleWebSecurityConfiguration configuration = HttpHeaderModuleWebSecurityConfiguration.build(httpModuleType, sequenceSuffix);
configuration.addAuthenticationProvider(getObjectObjectPostProcessor().postProcess(new PasswordProvider()));
HttpHeaderModuleWebSecurityConfigurer<HttpHeaderModuleWebSecurityConfiguration> module = getObjectObjectPostProcessor().postProcess(new HttpHeaderModuleWebSecurityConfigurer<>(configuration));
HttpSecurity http = getNewHttpSecurity(module);
setSharedObjects(http, sharedObjects);
ModuleAuthenticationImpl moduleAuthentication = createEmptyModuleAuthentication(configuration);
moduleAuthentication.setFocusType(httpModuleType.getFocusType());
SecurityFilterChain filter = http.build();
return AuthModuleImpl.build(filter, configuration, moduleAuthentication);
}
Aggregations