Package org.keycloak.social.github
Class GitHubIdentityProvider
- java.lang.Object
- 
- org.keycloak.broker.provider.AbstractIdentityProvider<C>
- 
- org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider
- 
- org.keycloak.social.github.GitHubIdentityProvider
 
 
 
- 
- All Implemented Interfaces:
- ExchangeExternalToken,- ExchangeTokenToIdentityProviderToken,- IdentityProvider,- SocialIdentityProvider,- Provider
 
 public class GitHubIdentityProvider extends AbstractOAuth2IdentityProvider implements SocialIdentityProvider - Author:
- Stian Thorgersen
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProviderAbstractOAuth2IdentityProvider.Endpoint
 - 
Nested classes/interfaces inherited from interface org.keycloak.broker.provider.IdentityProviderIdentityProvider.AuthenticationCallback
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected static StringAPI_URL_KEYAPI URL key in config map.static StringAUTH_FRAGMENTstatic StringAUTH_URLDeprecated.UseDEFAULT_AUTH_URLinstead.protected static StringBASE_URL_KEYBase URL key in config map.static StringDEFAULT_API_URLstatic StringDEFAULT_AUTH_URLstatic StringDEFAULT_BASE_URLstatic StringDEFAULT_EMAIL_URLstatic StringDEFAULT_PROFILE_URLstatic StringDEFAULT_SCOPEstatic StringDEFAULT_TOKEN_URLstatic StringEMAIL_FRAGMENTstatic StringEMAIL_URLDeprecated.UseDEFAULT_EMAIL_URLinstead.protected static StringEMAIL_URL_KEYEmail URL key in config map.static StringPROFILE_FRAGMENTstatic StringPROFILE_URLDeprecated.UseDEFAULT_PROFILE_URLinstead.static StringTOKEN_FRAGMENTstatic StringTOKEN_URLDeprecated.UseDEFAULT_TOKEN_URLinstead.- 
Fields inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProviderACCESS_DENIED, FEDERATED_REFRESH_TOKEN, FEDERATED_TOKEN_EXPIRATION, logger, mapper, OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE, OAUTH2_GRANT_TYPE_REFRESH_TOKEN, OAUTH2_PARAMETER_ACCESS_TOKEN, OAUTH2_PARAMETER_CLIENT_ID, OAUTH2_PARAMETER_CLIENT_SECRET, OAUTH2_PARAMETER_CODE, OAUTH2_PARAMETER_GRANT_TYPE, OAUTH2_PARAMETER_REDIRECT_URI, OAUTH2_PARAMETER_RESPONSE_TYPE, OAUTH2_PARAMETER_SCOPE, OAUTH2_PARAMETER_STATE
 - 
Fields inherited from class org.keycloak.broker.provider.AbstractIdentityProviderACCOUNT_LINK_URL, session
 - 
Fields inherited from interface org.keycloak.broker.provider.IdentityProviderEXTERNAL_IDENTITY_PROVIDER, FEDERATED_ACCESS_TOKEN
 
- 
 - 
Constructor SummaryConstructors Constructor Description GitHubIdentityProvider(KeycloakSession session, OAuth2IdentityProviderConfig config)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BrokeredIdentityContextdoGetFederatedIdentity(String accessToken)protected BrokeredIdentityContextextractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode profile)protected StringgetDefaultScopes()protected StringgetProfileEndpointForValidation(EventBuilder event)protected static StringgetUrlFromConfig(OAuth2IdentityProviderConfig config, String key, String defaultValue)Get URL from config with default value fallback.protected booleansupportsExternalExchange()- 
Methods inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProviderasJsonNode, authenticateTokenRequest, authenticationFinished, buildUserInfoRequest, callback, createAuthorizationUrl, exchangeExternal, exchangeExternalComplete, exchangeExternalImpl, exchangeExternalUserInfoValidationOnly, exchangeFromToken, exchangeSessionToken, exchangeStoredToken, extractTokenFromResponse, generateToken, getAccessTokenResponseParameter, getConfig, getFederatedIdentity, getJsonProperty, getSignatureContext, hasExternalExchangeToken, isIssuer, performLogin, retrieveToken, validateExternalTokenThroughUserInfo
 - 
Methods inherited from class org.keycloak.broker.provider.AbstractIdentityProviderbackchannelLogout, close, exchangeErrorResponse, exchangeNotLinked, exchangeNotLinkedNoStore, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, export, getLinkingUrl, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, updateBrokeredUser
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.broker.provider.IdentityProviderauthenticationFinished, backchannelLogout, callback, export, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, performLogin, preprocessFederatedIdentity, retrieveToken, updateBrokeredUser
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_BASE_URLpublic static final String DEFAULT_BASE_URL - See Also:
- Constant Field Values
 
 - 
AUTH_FRAGMENTpublic static final String AUTH_FRAGMENT - See Also:
- Constant Field Values
 
 - 
TOKEN_FRAGMENTpublic static final String TOKEN_FRAGMENT - See Also:
- Constant Field Values
 
 - 
DEFAULT_AUTH_URLpublic static final String DEFAULT_AUTH_URL - See Also:
- Constant Field Values
 
 - 
DEFAULT_TOKEN_URLpublic static final String DEFAULT_TOKEN_URL - See Also:
- Constant Field Values
 
 - 
AUTH_URL@Deprecated public static final String AUTH_URL Deprecated.UseDEFAULT_AUTH_URLinstead.- See Also:
- Constant Field Values
 
 - 
TOKEN_URL@Deprecated public static final String TOKEN_URL Deprecated.UseDEFAULT_TOKEN_URLinstead.- See Also:
- Constant Field Values
 
 - 
DEFAULT_API_URLpublic static final String DEFAULT_API_URL - See Also:
- Constant Field Values
 
 - 
PROFILE_FRAGMENTpublic static final String PROFILE_FRAGMENT - See Also:
- Constant Field Values
 
 - 
EMAIL_FRAGMENTpublic static final String EMAIL_FRAGMENT - See Also:
- Constant Field Values
 
 - 
DEFAULT_PROFILE_URLpublic static final String DEFAULT_PROFILE_URL - See Also:
- Constant Field Values
 
 - 
DEFAULT_EMAIL_URLpublic static final String DEFAULT_EMAIL_URL - See Also:
- Constant Field Values
 
 - 
PROFILE_URL@Deprecated public static final String PROFILE_URL Deprecated.UseDEFAULT_PROFILE_URLinstead.- See Also:
- Constant Field Values
 
 - 
EMAIL_URL@Deprecated public static final String EMAIL_URL Deprecated.UseDEFAULT_EMAIL_URLinstead.- See Also:
- Constant Field Values
 
 - 
DEFAULT_SCOPEpublic static final String DEFAULT_SCOPE - See Also:
- Constant Field Values
 
 - 
BASE_URL_KEYprotected static final String BASE_URL_KEY Base URL key in config map.- See Also:
- Constant Field Values
 
 - 
API_URL_KEYprotected static final String API_URL_KEY API URL key in config map.- See Also:
- Constant Field Values
 
 - 
EMAIL_URL_KEYprotected static final String EMAIL_URL_KEY Email URL key in config map.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
GitHubIdentityProviderpublic GitHubIdentityProvider(KeycloakSession session, OAuth2IdentityProviderConfig config) 
 
- 
 - 
Method Detail- 
getUrlFromConfigprotected static String getUrlFromConfig(OAuth2IdentityProviderConfig config, String key, String defaultValue) Get URL from config with default value fallback.- Parameters:
- config- Identity provider configuration.
- key- Key to look for value in config's config map.
- defaultValue- Default value if value at key is null or empty string.
- Returns:
- URL for specified key in the configuration with default value fallback.
 
 - 
supportsExternalExchangeprotected boolean supportsExternalExchange() - Overrides:
- supportsExternalExchangein class- AbstractOAuth2IdentityProvider
 
 - 
getProfileEndpointForValidationprotected String getProfileEndpointForValidation(EventBuilder event) - Overrides:
- getProfileEndpointForValidationin class- AbstractOAuth2IdentityProvider
 
 - 
extractIdentityFromProfileprotected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode profile) - Overrides:
- extractIdentityFromProfilein class- AbstractOAuth2IdentityProvider
 
 - 
doGetFederatedIdentityprotected BrokeredIdentityContext doGetFederatedIdentity(String accessToken) - Overrides:
- doGetFederatedIdentityin class- AbstractOAuth2IdentityProvider
 
 - 
getDefaultScopesprotected String getDefaultScopes() - Specified by:
- getDefaultScopesin class- AbstractOAuth2IdentityProvider
 
 
- 
 
-