use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationPolicyType 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();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationPolicyType 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);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractAuthenticationPolicyType 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);
}
Aggregations