Package org.keycloak.social.twitter
Class TwitterIdentityProvider
java.lang.Object
org.keycloak.broker.provider.AbstractIdentityProvider<OAuth2IdentityProviderConfig>
org.keycloak.social.twitter.TwitterIdentityProvider
- All Implemented Interfaces:
ExchangeTokenToIdentityProviderToken
,IdentityProvider<OAuth2IdentityProviderConfig>
,SocialIdentityProvider<OAuth2IdentityProviderConfig>
,Provider
public class TwitterIdentityProvider
extends AbstractIdentityProvider<OAuth2IdentityProviderConfig>
implements SocialIdentityProvider<OAuth2IdentityProviderConfig>, ExchangeTokenToIdentityProviderToken
- Author:
- Stian Thorgersen
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.broker.provider.IdentityProvider
IdentityProvider.AuthenticationCallback
-
Field Summary
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
ConstructorDescriptionTwitterIdentityProvider
(KeycloakSession session, OAuth2IdentityProviderConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticationFinished
(AuthenticationSessionModel authSession, BrokeredIdentityContext context) callback
(RealmModel realm, IdentityProvider.AuthenticationCallback callback, EventBuilder event) JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.jakarta.ws.rs.core.Response
exchangeFromToken
(jakarta.ws.rs.core.UriInfo uriInfo, EventBuilder builder, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject, jakarta.ws.rs.core.MultivaluedMap<String, String> params) protected jakarta.ws.rs.core.Response
exchangeSessionToken
(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) protected jakarta.ws.rs.core.Response
exchangeStoredToken
(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) jakarta.ws.rs.core.Response
performLogin
(AuthenticationRequest request) Initiates the authentication process by sending an authentication request to an identity provider.jakarta.ws.rs.core.Response
retrieveToken
(KeycloakSession session, FederatedIdentityModel identity) Returns aResponse
containing the token previously stored during the authentication process for a specific user.Methods inherited from class org.keycloak.broker.provider.AbstractIdentityProvider
backchannelLogout, close, exchangeErrorResponse, exchangeNotLinked, exchangeNotLinkedNoStore, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, export, getConfig, 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
backchannelLogout, export, getConfig, getMarshaller, importNewUser, isMapperSupported, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, reloadKeys, supportsLongStateParameter, updateBrokeredUser
-
Field Details
-
logger
protected static final org.jboss.logging.Logger logger
-
-
Constructor Details
-
TwitterIdentityProvider
-
-
Method Details
-
callback
public Object callback(RealmModel realm, IdentityProvider.AuthenticationCallback callback, EventBuilder event) Description copied from interface:IdentityProvider
JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.- Specified by:
callback
in interfaceIdentityProvider<OAuth2IdentityProviderConfig>
- Overrides:
callback
in classAbstractIdentityProvider<OAuth2IdentityProviderConfig>
- Returns:
-
performLogin
Description copied from interface:IdentityProvider
Initiates the authentication process by sending an authentication request to an identity provider. This method is called only once during the authentication.
- Specified by:
performLogin
in interfaceIdentityProvider<OAuth2IdentityProviderConfig>
- Overrides:
performLogin
in classAbstractIdentityProvider<OAuth2IdentityProviderConfig>
- Parameters:
request
- The initial authentication request. Contains all the contextual information in order to build an authentication request to the identity provider.- Returns:
-
exchangeFromToken
public jakarta.ws.rs.core.Response exchangeFromToken(jakarta.ws.rs.core.UriInfo uriInfo, EventBuilder builder, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject, jakarta.ws.rs.core.MultivaluedMap<String, String> params) - Specified by:
exchangeFromToken
in interfaceExchangeTokenToIdentityProviderToken
authorizedClient
- client requesting exchangetokenUserSession
- UserSessionModel of token exchanging fromtokenSubject
- UserModel of token exchanging fromparams
- form parameters received for requested exchange- Returns:
-
exchangeStoredToken
protected jakarta.ws.rs.core.Response exchangeStoredToken(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) -
exchangeSessionToken
protected jakarta.ws.rs.core.Response exchangeSessionToken(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) -
retrieveToken
public jakarta.ws.rs.core.Response retrieveToken(KeycloakSession session, FederatedIdentityModel identity) Description copied from interface:IdentityProvider
Returns a
Response
containing the token previously stored during the authentication process for a specific user.- Specified by:
retrieveToken
in interfaceIdentityProvider<OAuth2IdentityProviderConfig>
- Returns:
-
authenticationFinished
public void authenticationFinished(AuthenticationSessionModel authSession, BrokeredIdentityContext context) - Specified by:
authenticationFinished
in interfaceIdentityProvider<OAuth2IdentityProviderConfig>
- Overrides:
authenticationFinished
in classAbstractIdentityProvider<OAuth2IdentityProviderConfig>
-