org.keycloak.authentication.actiontoken

## Class DefaultActionTokenKey

- java.lang.Object
- - org.keycloak.representations.JsonWebToken
  - - org.keycloak.authentication.actiontoken.DefaultActionTokenKey

- All Implemented Interfaces:
    Serializable, ActionTokenKeyModel, Token
  Direct Known Subclasses:
    DefaultActionToken

      public class DefaultActionTokenKey
      extends JsonWebToken
      implements ActionTokenKeyModel

  Author:
    hmlnarik
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ACTION_TOKEN_USER_ID` The authenticationSession note with ID of the user authenticated via the action token
    `static String` | `JSON_FIELD_ACTION_VERIFICATION_NONCE`

    - ### Fields inherited from class org.keycloak.representations.JsonWebToken

      `audience, exp, iat, id, issuedFor, issuer, nbf, otherClaims, subject, type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultActionTokenKey()`
    `DefaultActionTokenKey(String userId, String actionId, int absoluteExpirationInSecs, UUID actionVerificationNonce)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DefaultActionTokenKey` | `from(String serializedKey)`
    `String` | `getActionId()`
    `UUID` | `getActionVerificationNonce()`
    `String` | `getUserId()`

    - ### Methods inherited from class org.keycloak.representations.JsonWebToken

      `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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.models.ActionTokenKeyModel

      `getExpiration, serializeKey`

- - ### Field Detail

    - #### ACTION_TOKEN_USER_ID

          public static final String ACTION_TOKEN_USER_ID

      The authenticationSession note with ID of the user authenticated via the action token
      See Also:
        Constant Field Values

    - #### JSON_FIELD_ACTION_VERIFICATION_NONCE

          public static final String JSON_FIELD_ACTION_VERIFICATION_NONCE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultActionTokenKey

          public DefaultActionTokenKey()

    - #### DefaultActionTokenKey

          public DefaultActionTokenKey(String userId,
                                       String actionId,
                                       int absoluteExpirationInSecs,
                                       UUID actionVerificationNonce)

  - ### Method Detail

    - #### getUserId

          public String getUserId()

      Specified by:
        `getUserId` in interface `ActionTokenKeyModel`
      Returns:
        ID of user which this token is for.

    - #### getActionId

          public String getActionId()

      Specified by:
        `getActionId` in interface `ActionTokenKeyModel`
      Returns:
        Action identifier this token is for.

    - #### getActionVerificationNonce

          public UUID getActionVerificationNonce()

      Specified by:
        `getActionVerificationNonce` in interface `ActionTokenKeyModel`
      Returns:
        Single-use random value used for verification whether the relevant action is allowed.

    - #### from

          public static DefaultActionTokenKey from(String serializedKey)

Copyright © 2020 JBoss by Red Hat. All rights reserved.