67 List<IdentityProviderModel> identityProviders = context.getRealm().getIdentityProviders();
68 for (IdentityProviderModel identityProvider : identityProviders) {
69 if (identityProvider.isEnabled() && providerId.equals(identityProvider.getAlias())) {
70 String accessCode =
new ClientSessionCode<>(context.getSession(), context.getRealm(), context.getAuthenticationSession()).getOrGenerateCode();
71 String clientId = context.getAuthenticationSession().getClient().getClientId();
72 String tabId = context.getAuthenticationSession().getTabId();
73 URI location = Urls.identityProviderAuthnRequest(context.getUriInfo().getBaseUri(), providerId, context.getRealm().getName(), accessCode, clientId, tabId);
74 if (context.getAuthenticationSession().getClientNote(OAuth2Constants.DISPLAY) != null) {
75 location = UriBuilder.fromUri(location).queryParam(OAuth2Constants.DISPLAY, context.getAuthenticationSession().getClientNote(OAuth2Constants.DISPLAY)).build();
77 Response response = Response.seeOther(location)
80 LOG.debugf(
"Redirecting to %s", providerId);
81 context.forceChallenge(response);
86 LOG.warnf(
"Provider not found or not enabled for realm %s", providerId);
static final Logger LOG
Definition: IdentityProviderAuthenticator.java:43