use of com.evolveum.midpoint.authentication.api.AuthenticationModuleState in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method createMpAuthentication.
protected Authentication createMpAuthentication(Authentication authentication) {
MidpointAuthentication mpAuthentication = new MidpointAuthentication(SecurityPolicyUtil.createDefaultSequence());
ModuleAuthentication moduleAuthentication = new ModuleAuthentication() {
@Override
public String getNameOfModule() {
return SecurityPolicyUtil.DEFAULT_MODULE_NAME;
}
@Override
public String getNameOfModuleType() {
return AuthenticationModuleNameConstants.LOGIN_FORM;
}
@Override
public AuthenticationModuleState getState() {
return AuthenticationModuleState.SUCCESSFULLY;
}
@Override
public void setState(AuthenticationModuleState state) {
}
@Override
public Authentication getAuthentication() {
return authentication;
}
@Override
public void setAuthentication(Authentication authentication) {
}
@Override
public String getPrefix() {
return ModuleWebSecurityConfiguration.DEFAULT_PREFIX_OF_MODULE_WITH_SLASH + ModuleWebSecurityConfiguration.DEFAULT_PREFIX_FOR_DEFAULT_MODULE + SecurityPolicyUtil.DEFAULT_MODULE_NAME + "/";
}
@Override
public QName getFocusType() {
return null;
}
};
mpAuthentication.addAuthentications(moduleAuthentication);
mpAuthentication.setPrincipal(authentication.getPrincipal());
return mpAuthentication;
}
Aggregations