Search in sources :

Example 11 with OAuthSPI

use of org.olat.login.oauth.OAuthSPI in project OpenOLAT by OpenOLAT.

the class OAuthAdminController method doDelete.

private void doDelete(ConfigurableProviderWrapper providerWrapper) {
    OAuthSPI spi = providerWrapper.getSpi();
    if (spi instanceof OpenIdConnectFullConfigurableProvider) {
        oauthModule.removeAdditionalOpenIDConnectIF(spi.getProviderName());
    }
    initCustomProviders();
}
Also used : OpenIdConnectFullConfigurableProvider(org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider) OAuthSPI(org.olat.login.oauth.OAuthSPI)

Example 12 with OAuthSPI

use of org.olat.login.oauth.OAuthSPI in project openolat by klemens.

the class DMZDispatcher method canRedirectConfigurableOAuth.

private boolean canRedirectConfigurableOAuth(HttpServletRequest request, HttpServletResponse response, OAuthLoginModule oauthModule) {
    String provider = request.getParameter("provider");
    if (StringHelper.containsNonWhitespace(provider)) {
        OAuthSPI spi = oauthModule.getProvider(provider);
        if (spi != null) {
            HttpSession session = request.getSession();
            OAuthResource.redirect(spi, response, session);
            return true;
        }
    }
    return false;
}
Also used : HttpSession(javax.servlet.http.HttpSession) OAuthSPI(org.olat.login.oauth.OAuthSPI)

Example 13 with OAuthSPI

use of org.olat.login.oauth.OAuthSPI in project openolat by klemens.

the class OAuthAdminController method doDelete.

private void doDelete(ConfigurableProviderWrapper providerWrapper) {
    OAuthSPI spi = providerWrapper.getSpi();
    if (spi instanceof OpenIdConnectFullConfigurableProvider) {
        oauthModule.removeAdditionalOpenIDConnectIF(spi.getProviderName());
    }
    initCustomProviders();
}
Also used : OpenIdConnectFullConfigurableProvider(org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider) OAuthSPI(org.olat.login.oauth.OAuthSPI)

Example 14 with OAuthSPI

use of org.olat.login.oauth.OAuthSPI in project openolat by klemens.

the class OAuthAdminController method initCustomProviders.

private void initCustomProviders() {
    // remove old ones
    for (ConfigurableProviderWrapper providerWrapper : providerWrappers) {
        FormItemContainer layoutCont = providerWrapper.getLayoutCont();
        customProvidersCont.remove(layoutCont);
    }
    providerWrappers.clear();
    List<OAuthSPI> configurableSpies = oauthModule.getAllConfigurableSPIs();
    for (OAuthSPI configurableSpi : configurableSpies) {
        if (configurableSpi instanceof OpenIdConnectFullConfigurableProvider) {
            ConfigurableProviderWrapper wrapper = initOpenIDConnectIFFullConfigurableProviders(customProvidersCont, (OpenIdConnectFullConfigurableProvider) configurableSpi);
            if (wrapper != null) {
                providerWrappers.add(wrapper);
            }
        }
    }
}
Also used : OpenIdConnectFullConfigurableProvider(org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider) OAuthSPI(org.olat.login.oauth.OAuthSPI) FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer)

Example 15 with OAuthSPI

use of org.olat.login.oauth.OAuthSPI in project openolat by klemens.

the class OAuthAuthenticationController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    for (OAuthSPI spi : oauthModule.getEnableSPIs()) {
        String spiName;
        int presentation;
        if (spi instanceof OAuthDisplayName) {
            spiName = ((OAuthDisplayName) spi).getDisplayName();
            presentation = Link.BUTTON | Link.NONTRANSLATED;
        } else {
            spiName = "login.".concat(spi.getName());
            presentation = Link.BUTTON;
        }
        FormLink button = uifactory.addFormLink(spiName, "login", spiName, null, formLayout, presentation);
        button.setIconLeftCSS(spi.getIconCSS());
        button.setElementCssClass("o_sel_auth_" + spi.getName());
        button.setUserObject(spi);
    }
}
Also used : OAuthDisplayName(org.olat.login.oauth.OAuthDisplayName) OAuthSPI(org.olat.login.oauth.OAuthSPI) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

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