Interface ActionTokenHandler<T extends JsonWebToken>
- 
- Type Parameters:
- T- Class implementing the action token
 - All Superinterfaces:
- Provider
 - All Known Implementing Classes:
- AbstractActionTokenHandler,- ExecuteActionsActionTokenHandler,- IdpVerifyAccountLinkActionTokenHandler,- ResetCredentialsActionTokenHandler,- UpdateEmailActionTokenHandler,- VerifyEmailActionTokenHandler
 
 public interface ActionTokenHandler<T extends JsonWebToken> extends Provider Handler of the action token.- Author:
- hmlnarik
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default 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.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.Class<T>getTokenClass()Returns the Java token class for use with deserialization.default TokenVerifier.Predicate<? super T>[]getVerifiers(ActionTokenContext<T> tokenContext)Returns an array of verifiers that are tested prior to handling the token.javax.ws.rs.core.ResponsehandleToken(T token, ActionTokenContext<T> tokenContext)Performs the action as per the token details.AuthenticationSessionModelstartFreshAuthenticationSession(T token, ActionTokenContext<T> tokenContext)Creates a fresh authentication session according to the information from the token.
 
- 
- 
- 
Method Detail- 
handleTokenjavax.ws.rs.core.Response handleToken(T token, ActionTokenContext<T> tokenContext) Performs the action as per the token details. This method is only called if all verifiers returned inhandleToken(T, org.keycloak.authentication.actiontoken.ActionTokenContext<T>)succeed.- Parameters:
- token-
- tokenContext-
- Returns:
 
 - 
getTokenClassClass<T> getTokenClass() Returns the Java token class for use with deserialization.- Returns:
 
 - 
getVerifiersdefault TokenVerifier.Predicate<? super T>[] getVerifiers(ActionTokenContext<T> tokenContext) Returns an array of verifiers that are tested prior to handling the token. All verifiers have to pass successfully for token to be handled. The returned array must not benull.- Parameters:
- tokenContext-
- Returns:
- Verifiers or an empty array. The returned array must not be null.
 
 - 
getAuthenticationSessionIdFromTokenString getAuthenticationSessionIdFromToken(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.- Parameters:
- token- Token. Can be- null
- tokenContext-
- 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
 
 - 
eventTypeEventType eventType() Returns a event type logged withEventBuilderclass.- Returns:
 
 - 
getDefaultEventErrorString getDefaultEventError() Returns an error to be shown in theEventBuilderdetail when token handling fails and no more specific error is provided.- Returns:
 
 - 
getDefaultErrorMessageString getDefaultErrorMessage() Returns an error to be shown in the response when token handling fails and no more specific error message is provided.- Returns:
 
 - 
startFreshAuthenticationSessionAuthenticationSessionModel startFreshAuthenticationSession(T token, ActionTokenContext<T> tokenContext) throws VerificationException Creates 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.- Parameters:
- token-
- tokenContext-
- Returns:
- Throws:
- VerificationException
 
 - 
canUseTokenRepeatedlyboolean canUseTokenRepeatedly(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.- Returns:
- see above
 
 
- 
 
-