Search in sources :

Example 1 with LdapModuleWebSecurityConfiguration

use of com.evolveum.midpoint.authentication.impl.module.configuration.LdapModuleWebSecurityConfiguration in project midpoint by Evolveum.

the class LdapModuleFactory 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 LdapAuthenticationModuleType)) {
        LOGGER.error("This factory support only LdapAuthenticationModuleType, but modelType is " + moduleType);
        return null;
    }
    isSupportedChannel(authenticationChannel);
    LdapModuleWebSecurityConfiguration configuration = LdapModuleWebSecurityConfiguration.build(moduleType, sequenceSuffix);
    configuration.setSequenceSuffix(sequenceSuffix);
    configuration.addAuthenticationProvider(getProvider((LdapAuthenticationModuleType) moduleType));
    LdapWebSecurityConfigurer<LdapModuleWebSecurityConfiguration> module = createModule(configuration);
    HttpSecurity http = getNewHttpSecurity(module);
    setSharedObjects(http, sharedObjects);
    ModuleAuthenticationImpl moduleAuthentication = createEmptyModuleAuthentication((LdapAuthenticationModuleType) moduleType, configuration);
    SecurityFilterChain filter = http.build();
    return AuthModuleImpl.build(filter, configuration, moduleAuthentication);
}
Also used : SecurityFilterChain(org.springframework.security.web.SecurityFilterChain) ModuleAuthenticationImpl(com.evolveum.midpoint.authentication.impl.module.authentication.ModuleAuthenticationImpl) HttpSecurity(org.springframework.security.config.annotation.web.builders.HttpSecurity) LdapModuleWebSecurityConfiguration(com.evolveum.midpoint.authentication.impl.module.configuration.LdapModuleWebSecurityConfiguration) LdapAuthenticationModuleType(com.evolveum.midpoint.xml.ns._public.common.common_3.LdapAuthenticationModuleType)

Aggregations

ModuleAuthenticationImpl (com.evolveum.midpoint.authentication.impl.module.authentication.ModuleAuthenticationImpl)1 LdapModuleWebSecurityConfiguration (com.evolveum.midpoint.authentication.impl.module.configuration.LdapModuleWebSecurityConfiguration)1 LdapAuthenticationModuleType (com.evolveum.midpoint.xml.ns._public.common.common_3.LdapAuthenticationModuleType)1 HttpSecurity (org.springframework.security.config.annotation.web.builders.HttpSecurity)1 SecurityFilterChain (org.springframework.security.web.SecurityFilterChain)1