use of com.evolveum.midpoint.authentication.api.config.MidpointAuthentication in project midpoint by Evolveum.
the class BasicMidPointAuthenticationSuccessHandler method onAuthenticationSuccess.
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
if (authentication instanceof MidpointAuthentication) {
MidpointAuthentication mpAuthentication = (MidpointAuthentication) authentication;
ModuleAuthentication moduleAuthentication = mpAuthentication.getProcessingModuleAuthentication();
moduleAuthentication.setState(AuthenticationModuleState.SUCCESSFULLY);
}
}
use of com.evolveum.midpoint.authentication.api.config.MidpointAuthentication 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.MidpointAuthentication in project midpoint by Evolveum.
the class MidPointAbstractAuthenticationProvider method createConnectEnvironment.
protected ConnectionEnvironment createConnectEnvironment(String channel) {
ConnectionEnvironment env = ConnectionEnvironment.create(channel);
Authentication actualAuthentication = SecurityContextHolder.getContext().getAuthentication();
if (actualAuthentication instanceof MidpointAuthentication && ((MidpointAuthentication) actualAuthentication).getSessionId() != null) {
env.setSessionIdOverride(((MidpointAuthentication) actualAuthentication).getSessionId());
}
return env;
}
use of com.evolveum.midpoint.authentication.api.config.MidpointAuthentication 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