public class DefaultActionToken extends DefaultActionTokenKey implements ActionTokenValueModel
Modifier and Type | Field and Description |
---|---|
static TokenVerifier.Predicate<DefaultActionTokenKey> |
ACTION_TOKEN_BASIC_CHECKS |
static String |
JSON_FIELD_AUTHENTICATION_SESSION_ID |
ACTION_TOKEN_USER_ID, JSON_FIELD_ACTION_VERIFICATION_NONCE
Modifier | Constructor and Description |
---|---|
|
DefaultActionToken()
Single-use random value used for verification whether the relevant action is allowed.
|
protected |
DefaultActionToken(String userId,
String actionId,
int absoluteExpirationInSecs,
UUID actionVerificationNonce) |
protected |
DefaultActionToken(String userId,
String actionId,
int absoluteExpirationInSecs,
UUID actionVerificationNonce,
String compoundAuthenticationSessionId) |
Modifier and Type | Method and Description |
---|---|
String |
getCompoundAuthenticationSessionId() |
String |
getNote(String name)
Returns value of the given note (or
null when no note of this name is present) |
Map<String,String> |
getNotes()
Returns unmodifiable map of all notes.
|
String |
removeNote(String name)
Removes given note, and returns original value (or
null when no value was present) |
String |
serialize(KeycloakSession session,
RealmModel realm,
javax.ws.rs.core.UriInfo uri)
Updates the following fields and serializes this token into a signed JWT.
|
void |
setCompoundAuthenticationSessionId(String authenticationSessionId) |
String |
setNote(String name,
String value)
Sets value of the given note
|
from, getActionId, getActionVerificationNonce, getUserId
addAudience, audience, exp, expiration, getAudience, getCategory, getExp, getExpiration, getIat, getId, getIssuedAt, getIssuedFor, getIssuer, getNbf, getNotBefore, getOtherClaims, getSubject, getType, hasAudience, iat, id, isActive, isActive, isExpired, isNotBefore, issuedAt, issuedFor, issuedNow, issuer, nbf, notBefore, setOtherClaims, setSubject, subject, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExpiration, serializeKey
public static final String JSON_FIELD_AUTHENTICATION_SESSION_ID
public static final TokenVerifier.Predicate<DefaultActionTokenKey> ACTION_TOKEN_BASIC_CHECKS
public DefaultActionToken()
protected DefaultActionToken(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce)
userId
- User IDactionId
- Action IDabsoluteExpirationInSecs
- Absolute expiration time in seconds in timezone of Keycloak.actionVerificationNonce
- protected DefaultActionToken(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce, String compoundAuthenticationSessionId)
userId
- User IDactionId
- Action IDabsoluteExpirationInSecs
- Absolute expiration time in seconds in timezone of Keycloak.actionVerificationNonce
- public String getCompoundAuthenticationSessionId()
public final void setCompoundAuthenticationSessionId(String authenticationSessionId)
public Map<String,String> getNotes()
ActionTokenValueModel
getNotes
in interface ActionTokenValueModel
null
.public String getNote(String name)
ActionTokenValueModel
null
when no note of this name is present)getNote
in interface ActionTokenValueModel
public final String setNote(String name, String value)
null
when no value was present)public final String removeNote(String name)
null
when no value was present)public String serialize(KeycloakSession session, RealmModel realm, javax.ws.rs.core.UriInfo uri)
id
: random nonceissuedAt
: Current timeissuer
: URI of the given realmaudience
: URI of the given realm (same as issuer)session
- realm
- uri
- Copyright © 2020 JBoss by Red Hat. All rights reserved.