Search in sources :

Example 1 with SmsAuthenticationPolicyType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType in project midpoint by Evolveum.

the class ResetPolicyDto method initResetPolicy.

private void initResetPolicy(AbstractCredentialsResetPolicyType resetPolicy, SecurityPolicyType securityPolicyType) throws SchemaException {
    this.formRef = resetPolicy.getFormRef();
    AbstractAuthenticationPolicyType authPolicy = SecurityPolicyUtil.getAuthenticationPolicy(resetPolicy.getAdditionalAuthenticationName(), securityPolicyType);
    if (authPolicy instanceof MailAuthenticationPolicyType) {
        this.mailAuthentication = (MailAuthenticationPolicyType) authPolicy;
        noncePolicy = SecurityPolicyUtil.getCredentialPolicy(mailAuthentication.getMailNonce(), securityPolicyType);
    } else if (authPolicy instanceof SmsAuthenticationPolicyType) {
        this.smsAuthentication = (SmsAuthenticationPolicyType) authPolicy;
        this.noncePolicy = SecurityPolicyUtil.getCredentialPolicy(smsAuthentication.getSmsNonce(), securityPolicyType);
    }
    this.name = resetPolicy.getName();
}
Also used : MailAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.MailAuthenticationPolicyType) SmsAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType) AbstractAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationPolicyType)

Example 2 with SmsAuthenticationPolicyType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType in project midpoint by Evolveum.

the class SelfRegistrationDto method initSelfRegistrationDto.

public void initSelfRegistrationDto(SecurityPolicyType securityPolicy) throws SchemaException {
    if (securityPolicy == null) {
        return;
    }
    SelfRegistrationPolicyType selfRegistration = getSelfRegistrationPolicy(securityPolicy);
    if (selfRegistration == null) {
        return;
    }
    this.name = selfRegistration.getName();
    this.defaultRoles = selfRegistration.getDefaultRole();
    this.initialLifecycleState = selfRegistration.getInitialLifecycleState();
    this.requiredLifecycleState = selfRegistration.getRequiredLifecycleState();
    this.formRef = selfRegistration.getFormRef();
    AbstractAuthenticationPolicyType authPolicy = SecurityPolicyUtil.getAuthenticationPolicy(selfRegistration.getAdditionalAuthenticationName(), securityPolicy);
    if (authPolicy instanceof MailAuthenticationPolicyType) {
        this.mailAuthenticationPolicy = (MailAuthenticationPolicyType) authPolicy;
        noncePolicy = SecurityPolicyUtil.getCredentialPolicy(((MailAuthenticationPolicyType) authPolicy).getMailNonce(), securityPolicy);
    } else if (authPolicy instanceof SmsAuthenticationPolicyType) {
        this.smsAuthenticationPolicy = (SmsAuthenticationPolicyType) authPolicy;
        noncePolicy = SecurityPolicyUtil.getCredentialPolicy(((SmsAuthenticationPolicyType) authPolicy).getSmsNonce(), securityPolicy);
    }
}
Also used : MailAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.MailAuthenticationPolicyType) SmsAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType) AbstractAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationPolicyType) SelfRegistrationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelfRegistrationPolicyType)

Example 3 with SmsAuthenticationPolicyType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType in project midpoint by Evolveum.

the class SecurityPolicyUtil method getAuthenticationPolicy.

public static AbstractAuthenticationPolicyType getAuthenticationPolicy(String authPolicyName, SecurityPolicyType securityPolicy) throws SchemaException {
    MailAuthenticationPolicyType mailAuthPolicy = getMailAuthenticationPolicy(authPolicyName, securityPolicy);
    SmsAuthenticationPolicyType smsAuthPolicy = getSmsAuthenticationPolicy(authPolicyName, securityPolicy);
    return checkAndGetAuthPolicyConsistence(mailAuthPolicy, smsAuthPolicy);
}
Also used : MailAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.MailAuthenticationPolicyType) SmsAuthenticationPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType)

Aggregations

MailAuthenticationPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.MailAuthenticationPolicyType)3 SmsAuthenticationPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.SmsAuthenticationPolicyType)3 AbstractAuthenticationPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationPolicyType)2 SelfRegistrationPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelfRegistrationPolicyType)1