Search in sources :

Example 6 with ValidationStatus

use of org.olat.core.util.ValidationStatus in project openolat by klemens.

the class AddOpenIDConnectIFFullConfigurableController method validateFormLogic.

@Override
protected boolean validateFormLogic(UserRequest ureq) {
    boolean allOk = true;
    allOk &= validate(openIdConnectIFName);
    List<ValidationStatus> nameValidation = new ArrayList<ValidationStatus>();
    openIdConnectIFName.validate(nameValidation);
    allOk &= nameValidation.isEmpty();
    allOk &= validate(openIdConnectIFDisplayName);
    allOk &= validate(openIdConnectIFApiKeyEl);
    allOk &= validate(openIdConnectIFApiSecretEl);
    allOk &= validate(openIdConnectIFIssuerEl);
    allOk &= validate(openIdConnectIFAuthorizationEndPointEl);
    String providerName = openIdConnectIFName.getValue();
    if (StringHelper.containsNonWhitespace(providerName)) {
        OAuthSPI existingSpi = oauthModule.getProvider(providerName);
        if (existingSpi != null) {
            openIdConnectIFName.setErrorKey("error.duplicate.provider", null);
            allOk &= false;
        }
    }
    return allOk & super.validateFormLogic(ureq);
}
Also used : ValidationStatus(org.olat.core.util.ValidationStatus) ArrayList(java.util.ArrayList) OAuthSPI(org.olat.login.oauth.OAuthSPI)

Aggregations

ValidationStatus (org.olat.core.util.ValidationStatus)6 ArrayList (java.util.ArrayList)4 DateChooser (org.olat.core.gui.components.form.flexible.elements.DateChooser)2 FormComponentTraverser (org.olat.core.util.component.FormComponentTraverser)2 OAuthSPI (org.olat.login.oauth.OAuthSPI)2