Search in sources :

Example 1 with OpenIdConnectFullConfigurableProvider

use of org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider in project OpenOLAT by OpenOLAT.

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 2 with OpenIdConnectFullConfigurableProvider

use of org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider in project OpenOLAT by OpenOLAT.

the class OAuthLoginModule method getAdditionalOpenIDConnectIF.

private OAuthSPI getAdditionalOpenIDConnectIF(String enableKey) {
    String providerName = enableKey.substring(OPEN_ID_IF_START_MARKER.length(), enableKey.length() - OPEN_ID_IF_END_MARKER.length());
    String rootEnabledObj = getStringPropertyValue("openIdConnectIF." + providerName + ".RootEnabled", true);
    boolean rootEnabled = "true".equals(rootEnabledObj);
    String apiKey = getStringPropertyValue("openIdConnectIF." + providerName + ".ApiKey", true);
    String apiSecret = getStringPropertyValue("openIdConnectIF." + providerName + ".ApiSecret", true);
    String issuer = getStringPropertyValue("openIdConnectIF." + providerName + ".Issuer", true);
    String endPoint = getStringPropertyValue("openIdConnectIF." + providerName + ".AuthorizationEndPoint", true);
    String displayName = getStringPropertyValue("openIdConnectIF." + providerName + ".DisplayName", true);
    OpenIdConnectFullConfigurableProvider provider = new OpenIdConnectFullConfigurableProvider();
    provider.setRootEnabled(rootEnabled);
    provider.setName(providerName);
    provider.setDisplayName(displayName);
    provider.setProviderName(providerName);
    provider.setAppKey(apiKey);
    provider.setAppSecret(apiSecret);
    provider.setIssuer(issuer);
    provider.setEndPoint(endPoint);
    return provider;
}
Also used : OpenIdConnectFullConfigurableProvider(org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider)

Example 3 with OpenIdConnectFullConfigurableProvider

use of org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider 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 4 with OpenIdConnectFullConfigurableProvider

use of org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider 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 5 with OpenIdConnectFullConfigurableProvider

use of org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider 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)

Aggregations

OpenIdConnectFullConfigurableProvider (org.olat.login.oauth.spi.OpenIdConnectFullConfigurableProvider)6 OAuthSPI (org.olat.login.oauth.OAuthSPI)4 FormItemContainer (org.olat.core.gui.components.form.flexible.FormItemContainer)2