Search in sources :

Example 1 with AuthModuleImpl

use of com.evolveum.midpoint.authentication.impl.util.AuthModuleImpl in project midpoint by Evolveum.

the class MidpointAuthFilter method processingOfAuthenticatedRequest.

private void processingOfAuthenticatedRequest(MidpointAuthentication mpAuthentication, ServletRequest httpRequest, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    for (ModuleAuthentication moduleAuthentication : mpAuthentication.getAuthentications()) {
        if (AuthenticationModuleState.SUCCESSFULLY.equals(moduleAuthentication.getState())) {
            int i = mpAuthentication.getIndexOfModule(moduleAuthentication);
            VirtualFilterChain vfc = new VirtualFilterChain(chain, ((AuthModuleImpl) mpAuthentication.getAuthModules().get(i)).getSecurityFilterChain().getFilters());
            vfc.doFilter(httpRequest, response);
        }
    }
}
Also used : ModuleAuthentication(com.evolveum.midpoint.authentication.api.config.ModuleAuthentication) AuthModuleImpl(com.evolveum.midpoint.authentication.impl.util.AuthModuleImpl)

Example 2 with AuthModuleImpl

use of com.evolveum.midpoint.authentication.impl.util.AuthModuleImpl in project midpoint by Evolveum.

the class MidpointAuthFilter method initAuthenticationModule.

private void initAuthenticationModule(MidpointAuthentication mpAuthentication, AuthenticationWrapper authWrapper, HttpServletRequest httpRequest) {
    if (AuthSequenceUtil.isSpecificSequence(httpRequest)) {
        if (authModulesOfSpecificSequences.containsKey(authWrapper.sequence.getName())) {
            authWrapper.authModules = authModulesOfSpecificSequences.get(authWrapper.sequence.getName());
            if (authWrapper.authModules != null) {
                for (AuthModule authModule : authWrapper.authModules) {
                    if (authModule != null && ((AuthModuleImpl) authModule).getConfiguration() != null) {
                        authenticationManager.getProviders().clear();
                        for (AuthenticationProvider authenticationProvider : ((AuthModuleImpl) authModule).getConfiguration().getAuthenticationProviders()) {
                            authenticationManager.getProviders().add(authenticationProvider);
                        }
                    }
                }
            }
        } else {
            authWrapper.authModules = createAuthenticationModuleBySequence(mpAuthentication, authWrapper.sequence, httpRequest, authWrapper.authenticationsPolicy.getModules(), authWrapper.authenticationChannel, authWrapper.credentialsPolicy);
            authModulesOfSpecificSequences.put(authWrapper.sequence.getName(), authWrapper.authModules);
        }
    } else {
        authWrapper.authModules = createAuthenticationModuleBySequence(mpAuthentication, authWrapper.sequence, httpRequest, authWrapper.authenticationsPolicy.getModules(), authWrapper.authenticationChannel, authWrapper.credentialsPolicy);
    }
}
Also used : AuthenticationProvider(org.springframework.security.authentication.AuthenticationProvider) AuthModule(com.evolveum.midpoint.authentication.api.AuthModule) AuthModuleImpl(com.evolveum.midpoint.authentication.impl.util.AuthModuleImpl)

Aggregations

AuthModuleImpl (com.evolveum.midpoint.authentication.impl.util.AuthModuleImpl)2 AuthModule (com.evolveum.midpoint.authentication.api.AuthModule)1 ModuleAuthentication (com.evolveum.midpoint.authentication.api.config.ModuleAuthentication)1 AuthenticationProvider (org.springframework.security.authentication.AuthenticationProvider)1