Class AbstractActionTokenHandler<T extends JsonWebToken>
- java.lang.Object
- 
- org.keycloak.authentication.actiontoken.AbstractActionTokenHandler<T>
 
- 
- All Implemented Interfaces:
- ActionTokenHandler<T>,- ActionTokenHandlerFactory<T>,- Provider,- ProviderFactory<ActionTokenHandler<T>>
 - Direct Known Subclasses:
- ExecuteActionsActionTokenHandler,- IdpVerifyAccountLinkActionTokenHandler,- ResetCredentialsActionTokenHandler,- UpdateEmailActionTokenHandler,- VerifyEmailActionTokenHandler
 
 public abstract class AbstractActionTokenHandler<T extends JsonWebToken> extends Object implements ActionTokenHandler<T>, ActionTokenHandlerFactory<T> - Author:
- hmlnarik
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanUseTokenRepeatedly(T token, ActionTokenContext<T> tokenContext)Returnstruewhen the token can be used repeatedly to invoke the action,falsewhen the token is intended to be for single use only.voidclose()This is called when the server shuts down.ActionTokenHandler<T>create(KeycloakSession session)EventTypeeventType()Returns a event type logged withEventBuilderclass.StringgetAuthenticationSessionIdFromToken(T token, ActionTokenContext<T> tokenContext, AuthenticationSessionModel currentAuthSession)Returns a compound authentication session ID requested from within the given token that the handler should attempt to join.StringgetDefaultErrorMessage()Returns an error to be shown in the response when token handling fails and no more specific error message is provided.StringgetDefaultEventError()Returns an error to be shown in theEventBuilderdetail when token handling fails and no more specific error is provided.StringgetId()Class<T>getTokenClass()Returns the Java token class for use with deserialization.voidinit(Config.Scope config)Only called once when the factory is first created.voidpostInit(KeycloakSessionFactory factory)Called after all provider factories have been initializedAuthenticationSessionModelstartFreshAuthenticationSession(T token, ActionTokenContext<T> tokenContext)Creates a fresh authentication session according to the information from the token.protected TokenVerifier.Predicate<DefaultActionToken>verifyEmail(ActionTokenContext<? extends DefaultActionToken> context)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.authentication.actiontoken.ActionTokenHandlergetVerifiers, handleToken
 - 
Methods inherited from interface org.keycloak.provider.ProviderFactorygetConfigMetadata, order
 
- 
 
- 
- 
- 
Method Detail- 
createpublic ActionTokenHandler<T> create(KeycloakSession session) - Specified by:
- createin interface- ProviderFactory<T extends JsonWebToken>
 
 - 
initpublic void init(Config.Scope config) Description copied from interface:ProviderFactoryOnly called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
- initin interface- ProviderFactory<T extends JsonWebToken>
 
 - 
postInitpublic void postInit(KeycloakSessionFactory factory) Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
- postInitin interface- ProviderFactory<T extends JsonWebToken>
 
 - 
getIdpublic String getId() - Specified by:
- getIdin interface- ProviderFactory<T extends JsonWebToken>
 
 - 
closepublic void close() Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
- closein interface- Provider
- Specified by:
- closein interface- ProviderFactory<T extends JsonWebToken>
 
 - 
getTokenClasspublic Class<T> getTokenClass() Description copied from interface:ActionTokenHandlerReturns the Java token class for use with deserialization.- Specified by:
- getTokenClassin interface- ActionTokenHandler<T extends JsonWebToken>
- Returns:
 
 - 
eventTypepublic EventType eventType() Description copied from interface:ActionTokenHandlerReturns a event type logged withEventBuilderclass.- Specified by:
- eventTypein interface- ActionTokenHandler<T extends JsonWebToken>
- Returns:
 
 - 
getDefaultErrorMessagepublic String getDefaultErrorMessage() Description copied from interface:ActionTokenHandlerReturns an error to be shown in the response when token handling fails and no more specific error message is provided.- Specified by:
- getDefaultErrorMessagein interface- ActionTokenHandler<T extends JsonWebToken>
- Returns:
 
 - 
getDefaultEventErrorpublic String getDefaultEventError() Description copied from interface:ActionTokenHandlerReturns an error to be shown in theEventBuilderdetail when token handling fails and no more specific error is provided.- Specified by:
- getDefaultEventErrorin interface- ActionTokenHandler<T extends JsonWebToken>
- Returns:
 
 - 
getAuthenticationSessionIdFromTokenpublic String getAuthenticationSessionIdFromToken(T token, ActionTokenContext<T> tokenContext, AuthenticationSessionModel currentAuthSession) Description copied from interface:ActionTokenHandlerReturns a compound authentication session ID requested from within the given token that the handler should attempt to join.- Specified by:
- getAuthenticationSessionIdFromTokenin interface- ActionTokenHandler<T extends JsonWebToken>
- Parameters:
- token- Token. Can be- null
- currentAuthSession- Authentication session that is currently in progress,- nullif no authentication session is not set
- Returns:
- Authentication session ID (can be nullif the token does not contain authentication session ID)
- See Also:
- AuthenticationSessionCompoundId
 
 - 
startFreshAuthenticationSessionpublic AuthenticationSessionModel startFreshAuthenticationSession(T token, ActionTokenContext<T> tokenContext) Description copied from interface:ActionTokenHandlerCreates a fresh authentication session according to the information from the token. The default implementation creates a new authentication session that requests termination after required actions.- Specified by:
- startFreshAuthenticationSessionin interface- ActionTokenHandler<T extends JsonWebToken>
- Returns:
 
 - 
canUseTokenRepeatedlypublic boolean canUseTokenRepeatedly(T token, ActionTokenContext<T> tokenContext) Description copied from interface:ActionTokenHandlerReturnstruewhen the token can be used repeatedly to invoke the action,falsewhen the token is intended to be for single use only.- Specified by:
- canUseTokenRepeatedlyin interface- ActionTokenHandler<T extends JsonWebToken>
- Returns:
- see above
 
 - 
verifyEmailprotected TokenVerifier.Predicate<DefaultActionToken> verifyEmail(ActionTokenContext<? extends DefaultActionToken> context) 
 
- 
 
-