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();
}
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;
}
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();
}
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);
}
}
}
}
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);
}
}
Aggregations