Class DefaultActionToken
java.lang.Object
org.keycloak.representations.JsonWebToken
org.keycloak.models.DefaultActionTokenKey
org.keycloak.authentication.actiontoken.DefaultActionToken
- All Implemented Interfaces:
- Serializable,- SingleUseObjectKeyModel,- SingleUseObjectValueModel,- Token
- Direct Known Subclasses:
- ExecuteActionsActionToken,- IdpVerifyAccountLinkActionToken,- ResetCredentialsActionToken,- UpdateEmailActionToken,- VerifyEmailActionToken
Part of action token that is intended to be used e.g. in link sent in password-reset email.
 The token encapsulates user, expected action and its time of expiry.
- Author:
- hmlnarik
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final TokenVerifier.Predicate<DefaultActionTokenKey>static final Stringstatic final StringFields inherited from class org.keycloak.models.DefaultActionTokenKeyACTION_TOKEN_USER_ID, JSON_FIELD_ACTION_VERIFICATION_NONCE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionSingle-use random value used for verification whether the relevant action is allowed.protectedDefaultActionToken(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce) protectedDefaultActionToken(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce, String compoundAuthenticationSessionId) 
- 
Method SummaryModifier and TypeMethodDescriptiongetEmail()Returns value of the given note (ornullwhen no note of this name is present)getNotes()Returns unmodifiable map of all notes.final StringremoveNote(String name) Removes given note, and returns original value (ornullwhen no value was present)serialize(KeycloakSession session, RealmModel realm, jakarta.ws.rs.core.UriInfo uri) Updates the following fields and serializes this token into a signed JWT.voidsetCompoundAuthenticationSessionId(String compoundAuthenticationSessionId) voidfinal StringSets value of the given noteMethods inherited from class org.keycloak.models.DefaultActionTokenKeyfrom, getActionId, getActionVerificationNonce, getUserIdMethods inherited from class org.keycloak.representations.JsonWebTokenaddAudience, audience, exp, expiration, getAudience, getCategory, getExp, getExpiration, getIat, getId, getIssuedAt, getIssuedFor, getIssuer, getNbf, getNotBefore, getOtherClaims, getSubject, getType, hasAnyAudience, hasAudience, iat, id, isActive, isActive, isExpired, isIssuedBeforeSessionStart, isNotBefore, issuedAt, issuedFor, issuedNow, issuer, nbf, notBefore, setOtherClaims, setSubject, subject, typeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.SingleUseObjectKeyModelgetExpiration, serializeKey
- 
Field Details- 
JSON_FIELD_AUTHENTICATION_SESSION_ID- See Also:
 
- 
JSON_FIELD_EMAIL- See Also:
 
- 
ACTION_TOKEN_BASIC_CHECKS
 
- 
- 
Constructor Details- 
DefaultActionTokenpublic DefaultActionToken()Single-use random value used for verification whether the relevant action is allowed.
- 
DefaultActionTokenprotected DefaultActionToken(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce) - Parameters:
- userId- User ID
- actionId- Action ID
- absoluteExpirationInSecs- Absolute expiration time in seconds in timezone of Keycloak.
- actionVerificationNonce-
 
- 
DefaultActionTokenprotected DefaultActionToken(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce, String compoundAuthenticationSessionId) - Parameters:
- userId- User ID
- actionId- Action ID
- absoluteExpirationInSecs- Absolute expiration time in seconds in timezone of Keycloak.
- actionVerificationNonce-
 
 
- 
- 
Method Details- 
getCompoundAuthenticationSessionId
- 
setCompoundAuthenticationSessionId
- 
getNotesDescription copied from interface:SingleUseObjectValueModelReturns unmodifiable map of all notes.- Specified by:
- getNotesin interface- SingleUseObjectValueModel
- Returns:
- see description. Returns empty map if no note is set, never returns null.
 
- 
getNoteDescription copied from interface:SingleUseObjectValueModelReturns value of the given note (ornullwhen no note of this name is present)- Specified by:
- getNotein interface- SingleUseObjectValueModel
- Returns:
- see description
 
- 
setNoteSets value of the given note- Returns:
- original value (or nullwhen no value was present)
 
- 
removeNoteRemoves given note, and returns original value (ornullwhen no value was present)- Returns:
- see description
 
- 
setEmail
- 
getEmail
- 
serializeUpdates the following fields and serializes this token into a signed JWT. The list of updated fields follows:- id: random nonce
- issuedAt: Current time
- issuer: URI of the given realm
- audience: URI of the given realm (same as issuer)
 - Parameters:
- session-
- realm-
- uri-
- Returns:
 
 
-