keycloak-service
公開メンバ関数 | 非公開メンバ関数 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator クラス
org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator の継承関係図
Inheritance graph
org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator 連携図
Collaboration graph

公開メンバ関数

void authenticate (AuthenticationFlowContext context)
 
void action (AuthenticationFlowContext context)
 
boolean requiresUser ()
 
boolean configuredFor (KeycloakSession session, RealmModel realm, UserModel user)
 
void setRequiredActions (KeycloakSession session, RealmModel realm, UserModel user)
 
void close ()
 

非公開メンバ関数

void redirect (AuthenticationFlowContext context, String providerId)
 

静的非公開変数類

static final Logger LOG = Logger.getLogger(IdentityProviderAuthenticator.class)
 

詳解

著者
Stian Thorgersen

関数詳解

◆ action()

void org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.action ( AuthenticationFlowContext  context)
inline
91  {
92  }

◆ authenticate()

void org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.authenticate ( AuthenticationFlowContext  context)
inline
46  {
47  if (context.getUriInfo().getQueryParameters().containsKey(AdapterConstants.KC_IDP_HINT)) {
48  String providerId = context.getUriInfo().getQueryParameters().getFirst(AdapterConstants.KC_IDP_HINT);
49  if (providerId == null || providerId.equals("")) {
50  LOG.tracef("Skipping: kc_idp_hint query parameter is empty");
51  context.attempted();
52  } else {
53  LOG.tracef("Redirecting: %s set to %s", AdapterConstants.KC_IDP_HINT, providerId);
54  redirect(context, providerId);
55  }
56  } else if (context.getAuthenticatorConfig() != null && context.getAuthenticatorConfig().getConfig().containsKey(IdentityProviderAuthenticatorFactory.DEFAULT_PROVIDER)) {
57  String defaultProvider = context.getAuthenticatorConfig().getConfig().get(IdentityProviderAuthenticatorFactory.DEFAULT_PROVIDER);
58  LOG.tracef("Redirecting: default provider set to %s", defaultProvider);
59  redirect(context, defaultProvider);
60  } else {
61  LOG.tracef("No default provider set or %s query parameter provided", AdapterConstants.KC_IDP_HINT);
62  context.attempted();
63  }
64  }
void redirect(AuthenticationFlowContext context, String providerId)
Definition: IdentityProviderAuthenticator.java:66
static final Logger LOG
Definition: IdentityProviderAuthenticator.java:43

◆ close()

void org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.close ( )
inline
109  {
110  }

◆ configuredFor()

boolean org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.configuredFor ( KeycloakSession  session,
RealmModel  realm,
UserModel  user 
)
inline
100  {
101  return true;
102  }

◆ redirect()

void org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.redirect ( AuthenticationFlowContext  context,
String  providerId 
)
inlineprivate
66  {
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();
76  }
77  Response response = Response.seeOther(location)
78  .build();
79 
80  LOG.debugf("Redirecting to %s", providerId);
81  context.forceChallenge(response);
82  return;
83  }
84  }
85 
86  LOG.warnf("Provider not found or not enabled for realm %s", providerId);
87  context.attempted();
88  }
static final Logger LOG
Definition: IdentityProviderAuthenticator.java:43

◆ requiresUser()

boolean org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.requiresUser ( )
inline
95  {
96  return false;
97  }

◆ setRequiredActions()

void org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.setRequiredActions ( KeycloakSession  session,
RealmModel  realm,
UserModel  user 
)
inline
105  {
106  }

メンバ詳解

◆ LOG

final Logger org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticator.LOG = Logger.getLogger(IdentityProviderAuthenticator.class)
staticprivate

このクラス詳解は次のファイルから抽出されました: