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.AbstractOAuth2IdentityProvider
AbstractOAuth2IdentityProvider.EndpointNested classes/interfaces inherited from interface org.keycloak.broker.provider.IdentityProvider
IdentityProvider.AuthenticationCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringAPI URL key in config map.static final Stringstatic final StringDeprecated.protected static final StringBase URL key in config map.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.UseDEFAULT_EMAIL_URLinstead.protected static final StringEmail URL key in config map.static final Stringstatic final StringDeprecated.UseDEFAULT_PROFILE_URLinstead.static final Stringstatic final StringDeprecated.UseDEFAULT_TOKEN_URLinstead.Fields inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider
ACCESS_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_STATEFields inherited from class org.keycloak.broker.provider.AbstractIdentityProvider
ACCOUNT_LINK_URL, sessionFields inherited from interface org.keycloak.broker.provider.IdentityProvider
EXTERNAL_IDENTITY_PROVIDER, FEDERATED_ACCESS_TOKEN -
Constructor Summary
ConstructorsConstructorDescriptionGitHubIdentityProvider(KeycloakSession session, OAuth2IdentityProviderConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected BrokeredIdentityContextdoGetFederatedIdentity(String accessToken) protected BrokeredIdentityContextextractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode profile) protected Stringprotected Stringprotected static StringgetUrlFromConfig(OAuth2IdentityProviderConfig config, String key, String defaultValue) Get URL from config with default value fallback.protected booleanMethods inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider
asJsonNode, authenticateTokenRequest, authenticationFinished, buildUserInfoRequest, callback, createAuthorizationUrl, exchangeExternal, exchangeExternalComplete, exchangeExternalImpl, exchangeExternalUserInfoValidationOnly, exchangeFromToken, exchangeSessionToken, exchangeStoredToken, extractTokenFromResponse, generateToken, getAccessTokenResponseParameter, getConfig, getFederatedIdentity, getJsonProperty, getSignatureContext, hasExternalExchangeToken, isIssuer, performLogin, retrieveToken, validateExternalTokenThroughUserInfoMethods inherited from class org.keycloak.broker.provider.AbstractIdentityProvider
backchannelLogout, close, exchangeErrorResponse, exchangeNotLinked, exchangeNotLinkedNoStore, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, export, getLinkingUrl, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, updateBrokeredUserMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.broker.provider.IdentityProvider
authenticationFinished, backchannelLogout, callback, export, getConfig, getMarshaller, importNewUser, isMapperSupported, keycloakInitiatedBrowserLogout, performLogin, preprocessFederatedIdentity, reloadKeys, retrieveToken, supportsLongStateParameter, updateBrokeredUser
-
Field Details
-
DEFAULT_BASE_URL
- See Also:
-
AUTH_FRAGMENT
- See Also:
-
TOKEN_FRAGMENT
- See Also:
-
DEFAULT_AUTH_URL
- See Also:
-
DEFAULT_TOKEN_URL
- See Also:
-
AUTH_URL
Deprecated.UseDEFAULT_AUTH_URLinstead.- See Also:
-
TOKEN_URL
Deprecated.UseDEFAULT_TOKEN_URLinstead.- See Also:
-
DEFAULT_API_URL
- See Also:
-
PROFILE_FRAGMENT
- See Also:
-
EMAIL_FRAGMENT
- See Also:
-
DEFAULT_PROFILE_URL
- See Also:
-
DEFAULT_EMAIL_URL
- See Also:
-
PROFILE_URL
Deprecated.UseDEFAULT_PROFILE_URLinstead.- See Also:
-
EMAIL_URL
Deprecated.UseDEFAULT_EMAIL_URLinstead.- See Also:
-
DEFAULT_SCOPE
- See Also:
-
BASE_URL_KEY
Base URL key in config map.- See Also:
-
API_URL_KEY
API URL key in config map.- See Also:
-
EMAIL_URL_KEY
Email URL key in config map.- See Also:
-
-
Constructor Details
-
GitHubIdentityProvider
-
-
Method Details
-
getUrlFromConfig
protected 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.
-
supportsExternalExchange
protected boolean supportsExternalExchange()- Overrides:
supportsExternalExchangein classAbstractOAuth2IdentityProvider
-
getProfileEndpointForValidation
- Overrides:
getProfileEndpointForValidationin classAbstractOAuth2IdentityProvider
-
extractIdentityFromProfile
protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode profile) - Overrides:
extractIdentityFromProfilein classAbstractOAuth2IdentityProvider
-
doGetFederatedIdentity
- Overrides:
doGetFederatedIdentityin classAbstractOAuth2IdentityProvider
-
getDefaultScopes
- Specified by:
getDefaultScopesin classAbstractOAuth2IdentityProvider
-
DEFAULT_AUTH_URLinstead.