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);
}
}
}
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);
}
}
Aggregations