T - Class implementing the action tokenpublic interface ActionTokenHandler<T extends JsonWebToken> extends Provider
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUseTokenRepeatedly(T token,
ActionTokenContext<T> tokenContext)
Returns
true when the token can be used repeatedly to invoke the action, false when the token
is intended to be for single use only. |
EventType |
eventType()
Returns a event type logged with
EventBuilder class. |
String |
getAuthenticationSessionIdFromToken(T token,
ActionTokenContext<T> tokenContext)
Returns an authentication session ID requested from within the given token
|
String |
getDefaultErrorMessage()
Returns an error to be shown in the response when token handling fails and no more specific
error message is provided.
|
String |
getDefaultEventError()
Returns an error to be shown in the
EventBuilder detail 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.Response |
handleToken(T token,
ActionTokenContext<T> tokenContext)
Performs the action as per the token details.
|
AuthenticationSessionModel |
startFreshAuthenticationSession(T token,
ActionTokenContext<T> tokenContext)
Creates a fresh authentication session according to the information from the token.
|
javax.ws.rs.core.Response handleToken(T token, ActionTokenContext<T> tokenContext)
handleToken(T, org.keycloak.authentication.actiontoken.ActionTokenContext<T>) succeed.token - tokenContext - Class<T> getTokenClass()
default TokenVerifier.Predicate<? super T>[] getVerifiers(ActionTokenContext<T> tokenContext)
null.tokenContext - null.String getAuthenticationSessionIdFromToken(T token, ActionTokenContext<T> tokenContext)
token - Token. Can be nullEventType eventType()
EventBuilder class.String getDefaultEventError()
EventBuilder detail when token handling fails and
no more specific error is provided.String getDefaultErrorMessage()
AuthenticationSessionModel startFreshAuthenticationSession(T token, ActionTokenContext<T> tokenContext) throws org.keycloak.common.VerificationException
token - tokenContext - org.keycloak.common.VerificationExceptionboolean canUseTokenRepeatedly(T token, ActionTokenContext<T> tokenContext)
true when the token can be used repeatedly to invoke the action, false when the token
is intended to be for single use only.Copyright © 2017 JBoss by Red Hat. All rights reserved.