Class StackoverflowIdentityProvider
- java.lang.Object
-
- org.keycloak.broker.provider.AbstractIdentityProvider<C>
-
- org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig>
-
- org.keycloak.social.stackoverflow.StackoverflowIdentityProvider
-
- All Implemented Interfaces:
ExchangeExternalToken
,ExchangeTokenToIdentityProviderToken
,IdentityProvider<StackOverflowIdentityProviderConfig>
,SocialIdentityProvider<StackOverflowIdentityProviderConfig>
,Provider
public class StackoverflowIdentityProvider extends AbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig> implements SocialIdentityProvider<StackOverflowIdentityProviderConfig>
Stackoverflow social provider. See https://api.stackexchange.com/docs/authentication- Author:
- Vlastimil Elias (velias at redhat dot com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider
AbstractOAuth2IdentityProvider.Endpoint
-
Nested classes/interfaces inherited from interface org.keycloak.broker.provider.IdentityProvider
IdentityProvider.AuthenticationCallback
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUTH_URL
static String
DEFAULT_SCOPE
static String
PROFILE_URL
static String
TOKEN_URL
-
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_STATE
-
Fields inherited from class org.keycloak.broker.provider.AbstractIdentityProvider
ACCOUNT_LINK_URL, session
-
Fields inherited from interface org.keycloak.broker.provider.IdentityProvider
EXTERNAL_IDENTITY_PROVIDER, FEDERATED_ACCESS_TOKEN
-
-
Constructor Summary
Constructors Constructor Description StackoverflowIdentityProvider(KeycloakSession session, StackOverflowIdentityProviderConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SimpleHttp
buildUserInfoRequest(String subjectToken, String userInfoUrl)
protected BrokeredIdentityContext
doGetFederatedIdentity(String accessToken)
protected BrokeredIdentityContext
extractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode node)
protected static String
extractUsernameFromProfileURL(String profileURL)
protected String
getDefaultScopes()
protected String
getProfileEndpointForValidation(EventBuilder event)
protected boolean
supportsExternalExchange()
static String
unescapeHtml3(String input)
-
Methods inherited from class org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider
asJsonNode, authenticateTokenRequest, authenticationFinished, 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.AbstractIdentityProvider
backchannelLogout, close, exchangeErrorResponse, exchangeNotLinked, exchangeNotLinkedNoStore, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, export, getLinkingUrl, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, updateBrokeredUser
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.broker.provider.IdentityProvider
authenticationFinished, backchannelLogout, callback, export, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, performLogin, preprocessFederatedIdentity, retrieveToken, updateBrokeredUser
-
-
-
-
Field Detail
-
AUTH_URL
public static final String AUTH_URL
- See Also:
- Constant Field Values
-
TOKEN_URL
public static final String TOKEN_URL
- See Also:
- Constant Field Values
-
PROFILE_URL
public static final String PROFILE_URL
- See Also:
- Constant Field Values
-
DEFAULT_SCOPE
public static final String DEFAULT_SCOPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StackoverflowIdentityProvider
public StackoverflowIdentityProvider(KeycloakSession session, StackOverflowIdentityProviderConfig config)
-
-
Method Detail
-
supportsExternalExchange
protected boolean supportsExternalExchange()
- Overrides:
supportsExternalExchange
in classAbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig>
-
getProfileEndpointForValidation
protected String getProfileEndpointForValidation(EventBuilder event)
-
buildUserInfoRequest
protected SimpleHttp buildUserInfoRequest(String subjectToken, String userInfoUrl)
- Overrides:
buildUserInfoRequest
in classAbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig>
-
extractIdentityFromProfile
protected BrokeredIdentityContext extractIdentityFromProfile(EventBuilder event, com.fasterxml.jackson.databind.JsonNode node)
- Overrides:
extractIdentityFromProfile
in classAbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig>
-
doGetFederatedIdentity
protected BrokeredIdentityContext doGetFederatedIdentity(String accessToken)
- Overrides:
doGetFederatedIdentity
in classAbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig>
-
extractUsernameFromProfileURL
protected static String extractUsernameFromProfileURL(String profileURL)
-
getDefaultScopes
protected String getDefaultScopes()
- Specified by:
getDefaultScopes
in classAbstractOAuth2IdentityProvider<StackOverflowIdentityProviderConfig>
-
-