Search in sources :

Example 16 with OAuthSPI

use of org.olat.login.oauth.OAuthSPI 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

OAuthSPI (org.olat.login.oauth.OAuthSPI)16 HttpSession (javax.servlet.http.HttpSession)4 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)4 OpenIdConnectFullConfigurableProvider (org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider)4 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 UserRequest (org.olat.core.gui.UserRequest)2 UserRequestImpl (org.olat.core.gui.UserRequestImpl)2 Windows (org.olat.core.gui.Windows)2 Window (org.olat.core.gui.components.Window)2 FormItemContainer (org.olat.core.gui.components.form.flexible.FormItemContainer)2 InvalidRequestParameterException (org.olat.core.gui.components.form.flexible.impl.InvalidRequestParameterException)2 ChiefController (org.olat.core.gui.control.ChiefController)2 ChiefControllerCreator (org.olat.core.gui.control.ChiefControllerCreator)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 UserSession (org.olat.core.util.UserSession)2 ValidationStatus (org.olat.core.util.ValidationStatus)2 UserSessionManager (org.olat.core.util.session.UserSessionManager)2 OAuthDisplayName (org.olat.login.oauth.OAuthDisplayName)2 OAuthLoginModule (org.olat.login.oauth.OAuthLoginModule)2