use of com.evolveum.midpoint.authentication.impl.module.authentication.CredentialModuleAuthenticationImpl in project midpoint by Evolveum.
the class AbstractCredentialProvider method supports.
public boolean supports(Class<?> authenticationClass, Authentication authentication) {
if (!(authentication instanceof MidpointAuthentication)) {
return supports(authenticationClass);
}
MidpointAuthentication mpAuthentication = (MidpointAuthentication) authentication;
ModuleAuthenticationImpl moduleAuthentication = (ModuleAuthenticationImpl) 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;
}
if (moduleAuthentication instanceof CredentialModuleAuthenticationImpl) {
Class<? extends CredentialPolicyType> moduleCredentialType = ((CredentialModuleAuthenticationImpl) moduleAuthentication).getCredentialType();
if (moduleCredentialType == null) {
return false;
}
if (!getTypeOfCredential().equals(moduleCredentialType)) {
return false;
}
}
return supports(moduleAuthentication.getAuthentication().getClass());
}
Aggregations