Package org.keycloak.broker.provider
Class AbstractIdentityProvider<C extends IdentityProviderModel>
java.lang.Object
org.keycloak.broker.provider.AbstractIdentityProvider<C>
- All Implemented Interfaces:
IdentityProvider<C>,UserAuthenticationIdentityProvider<C>,Provider
- Direct Known Subclasses:
AbstractOAuth2IdentityProvider,SAMLIdentityProvider,TwitterIdentityProvider
public abstract class AbstractIdentityProvider<C extends IdentityProviderModel>
extends Object
implements UserAuthenticationIdentityProvider<C>
- Author:
- Pedro Igor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.broker.provider.UserAuthenticationIdentityProvider
UserAuthenticationIdentityProvider.AuthenticationCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static final org.jboss.logging.Loggerprotected final KeycloakSessionstatic final Stringstatic final StringFields inherited from interface org.keycloak.broker.provider.UserAuthenticationIdentityProvider
EXTERNAL_IDENTITY_PROVIDER, FEDERATED_ACCESS_TOKEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticationFinished(AuthenticationSessionModel authSession, BrokeredIdentityContext context) voidbackchannelLogout(KeycloakSession session, UserSessionModel userSession, jakarta.ws.rs.core.UriInfo uriInfo, RealmModel realm) callback(RealmModel realm, UserAuthenticationIdentityProvider.AuthenticationCallback callback, EventBuilder event) JAXRS callback endpoint for when the remote IDP wants to callback to keycloak.voidclose()protected jakarta.ws.rs.core.ResponseexchangeErrorResponse(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, String errorCode, String reason) jakarta.ws.rs.core.ResponseexchangeNotLinked(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) jakarta.ws.rs.core.ResponseexchangeNotLinkedNoStore(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) jakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponseexchangeTokenExpired(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) jakarta.ws.rs.core.Responseprotected StringgetLinkingUrl(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession) Implementation of marshaller to serialize/deserialize attached data to Strings, which can be saved in clientSessionvoidimportNewUser(KeycloakSession session, RealmModel realm, UserModel user, BrokeredIdentityContext context) jakarta.ws.rs.core.ResponsekeycloakInitiatedBrowserLogout(KeycloakSession session, UserSessionModel userSession, jakarta.ws.rs.core.UriInfo uriInfo, RealmModel realm) Called when a Keycloak application initiates a logout through the browser.jakarta.ws.rs.core.ResponseperformLogin(AuthenticationRequest request) Initiates the authentication process by sending an authentication request to an identity provider.voidpreprocessFederatedIdentity(KeycloakSession session, RealmModel realm, BrokeredIdentityContext context) protected voidsetEmailVerified(UserModel user, BrokeredIdentityContext context) voidupdateBrokeredUser(KeycloakSession session, RealmModel realm, UserModel user, BrokeredIdentityContext context) protected voidupdateEmail(UserModel user, BrokeredIdentityContext context) Methods 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
export, isMapperSupported, reloadKeysMethods inherited from interface org.keycloak.broker.provider.UserAuthenticationIdentityProvider
retrieveToken, supportsLongStateParameter
-
Field Details
-
logger
protected static final org.jboss.logging.Logger logger -
UPDATE_PROFILE_EMAIL_CHANGED
- See Also:
-
UPDATE_PROFILE_USERNAME_CHANGED
- See Also:
-
BROKER_REGISTERED_NEW_USER
- See Also:
-
ACCOUNT_LINK_URL
- See Also:
-
session
-
-
Constructor Details
-
AbstractIdentityProvider
-
-
Method Details
-
getConfig
- Specified by:
getConfigin interfaceIdentityProvider<C extends IdentityProviderModel>
-
close
public void close() -
callback
public Object callback(RealmModel realm, UserAuthenticationIdentityProvider.AuthenticationCallback callback, EventBuilder event) Description copied from interface:UserAuthenticationIdentityProviderJAXRS callback endpoint for when the remote IDP wants to callback to keycloak.- Specified by:
callbackin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>- Returns:
-
performLogin
Description copied from interface:UserAuthenticationIdentityProviderInitiates the authentication process by sending an authentication request to an identity provider. This method is called only once during the authentication.
- Specified by:
performLoginin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>- Parameters:
request- The initial authentication request. Contains all the contextual information in order to build an authentication request to the identity provider.- Returns:
-
keycloakInitiatedBrowserLogout
public jakarta.ws.rs.core.Response keycloakInitiatedBrowserLogout(KeycloakSession session, UserSessionModel userSession, jakarta.ws.rs.core.UriInfo uriInfo, RealmModel realm) Description copied from interface:UserAuthenticationIdentityProviderCalled when a Keycloak application initiates a logout through the browser. This is expected to do a logout with the IDP- Specified by:
keycloakInitiatedBrowserLogoutin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>- Returns:
- null if this is not supported by this provider
-
backchannelLogout
public void backchannelLogout(KeycloakSession session, UserSessionModel userSession, jakarta.ws.rs.core.UriInfo uriInfo, RealmModel realm) - Specified by:
backchannelLogoutin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>
-
exchangeNotSupported
public jakarta.ws.rs.core.Response exchangeNotSupported() -
exchangeNotLinked
public jakarta.ws.rs.core.Response exchangeNotLinked(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) -
exchangeNotLinkedNoStore
public jakarta.ws.rs.core.Response exchangeNotLinkedNoStore(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) -
exchangeErrorResponse
protected jakarta.ws.rs.core.Response exchangeErrorResponse(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, String errorCode, String reason) -
getLinkingUrl
protected String getLinkingUrl(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession) -
exchangeTokenExpired
public jakarta.ws.rs.core.Response exchangeTokenExpired(jakarta.ws.rs.core.UriInfo uriInfo, ClientModel authorizedClient, UserSessionModel tokenUserSession, UserModel tokenSubject) -
exchangeUnsupportedRequiredType
public jakarta.ws.rs.core.Response exchangeUnsupportedRequiredType() -
authenticationFinished
public void authenticationFinished(AuthenticationSessionModel authSession, BrokeredIdentityContext context) - Specified by:
authenticationFinishedin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>
-
preprocessFederatedIdentity
public void preprocessFederatedIdentity(KeycloakSession session, RealmModel realm, BrokeredIdentityContext context) - Specified by:
preprocessFederatedIdentityin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>
-
importNewUser
public void importNewUser(KeycloakSession session, RealmModel realm, UserModel user, BrokeredIdentityContext context) - Specified by:
importNewUserin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>
-
updateBrokeredUser
public void updateBrokeredUser(KeycloakSession session, RealmModel realm, UserModel user, BrokeredIdentityContext context) - Specified by:
updateBrokeredUserin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>
-
updateEmail
-
setEmailVerified
-
getMarshaller
Description copied from interface:UserAuthenticationIdentityProviderImplementation of marshaller to serialize/deserialize attached data to Strings, which can be saved in clientSession- Specified by:
getMarshallerin interfaceUserAuthenticationIdentityProvider<C extends IdentityProviderModel>- Returns:
-