Search in sources :

Example 1 with SelfRegistrationPolicyType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SelfRegistrationPolicyType 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)

Aggregations

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