use of com.evolveum.midpoint.authentication.api.config.ModuleAuthentication in project midpoint by Evolveum.
the class MidPointAbstractAuthenticationProvider method initAuthRequirements.
private Authentication initAuthRequirements(Authentication processingAuthentication, Authentication originalAuthentication, Authentication actualAuthentication, AuthenticationRequirements authRequirements) {
if (originalAuthentication instanceof MidpointAuthentication) {
MidpointAuthentication mpAuthentication = (MidpointAuthentication) originalAuthentication;
ModuleAuthentication moduleAuthentication = getProcessingModule(mpAuthentication);
if (moduleAuthentication.getFocusType() != null) {
authRequirements.focusType = PrismContext.get().getSchemaRegistry().determineCompileTimeClass(moduleAuthentication.getFocusType());
}
authRequirements.requireAssignment = mpAuthentication.getSequence().getRequireAssignmentTarget();
authRequirements.channel = mpAuthentication.getAuthenticationChannel();
return moduleAuthentication.getAuthentication();
} else if (actualAuthentication instanceof MidpointAuthentication) {
MidpointAuthentication mpAuthentication = (MidpointAuthentication) actualAuthentication;
ModuleAuthentication moduleAuthentication = getProcessingModule(mpAuthentication);
if (moduleAuthentication != null && moduleAuthentication.getFocusType() != null) {
authRequirements.focusType = PrismContext.get().getSchemaRegistry().determineCompileTimeClass(moduleAuthentication.getFocusType());
}
authRequirements.requireAssignment = mpAuthentication.getSequence().getRequireAssignmentTarget();
authRequirements.channel = mpAuthentication.getAuthenticationChannel();
}
return processingAuthentication;
}
use of com.evolveum.midpoint.authentication.api.config.ModuleAuthentication in project midpoint by Evolveum.
the class MidPointAbstractAuthenticationProvider method supports.
public boolean supports(Class<?> authenticationClass, Authentication authentication) {
if (!(authentication instanceof MidpointAuthentication)) {
return supports(authenticationClass);
}
MidpointAuthentication mpAuthentication = (MidpointAuthentication) authentication;
ModuleAuthentication moduleAuthentication = getProcessingModule(mpAuthentication);
if (moduleAuthentication == null || moduleAuthentication.getAuthentication() == null) {
return false;
}
if (moduleAuthentication.getAuthentication() instanceof AnonymousAuthenticationToken) {
// hack for specific situation when user is anonymous, but accessDecisionManager resolve it
return true;
}
return supports(moduleAuthentication.getAuthentication().getClass());
}
Aggregations