Search in sources :

Example 1 with AuthenticationModuleState

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;
}
Also used : ModuleAuthentication(com.evolveum.midpoint.authentication.api.config.ModuleAuthentication) AuthenticationModuleState(com.evolveum.midpoint.authentication.api.AuthenticationModuleState) Authentication(org.springframework.security.core.Authentication) ModuleAuthentication(com.evolveum.midpoint.authentication.api.config.ModuleAuthentication) MidpointAuthentication(com.evolveum.midpoint.authentication.api.config.MidpointAuthentication) MidpointAuthentication(com.evolveum.midpoint.authentication.api.config.MidpointAuthentication)

Aggregations

AuthenticationModuleState (com.evolveum.midpoint.authentication.api.AuthenticationModuleState)1 MidpointAuthentication (com.evolveum.midpoint.authentication.api.config.MidpointAuthentication)1 ModuleAuthentication (com.evolveum.midpoint.authentication.api.config.ModuleAuthentication)1 Authentication (org.springframework.security.core.Authentication)1