Interface AccessTokenBuilder

All Known Implementing Classes:
AccessTokenBuilderImpl

public interface AccessTokenBuilder
Author:
Filip Hrisafov
  • Method Details

    • userId

      AccessTokenBuilder userId(String userId)
      The id of the user to which the token belongs. This can be any user which isn't part of the Identity Service.
      Parameters:
      userId - the id of the user
    • tenantId

      AccessTokenBuilder tenantId(String tenantId)
      The id of the tenant to which the token belongs.
      Parameters:
      tenantId - the id of the user
    • name

      The name that should be used for the token.
      Parameters:
      name - the name for the token
    • description

      AccessTokenBuilder description(String description)
      The optional description that should be used for the token.
      Parameters:
      description - the description for the token
    • validFor

      AccessTokenBuilder validFor(Duration validityDuration)
      The duration for which the token is valid. It must be a positive duration. This is mutually exclusive with validUntil(Instant).
      Parameters:
      validityDuration - the positive duration
    • validUntil

      AccessTokenBuilder validUntil(Instant validUntil)
      Until when the token is valid. This is mutually exclusive with validFor(Duration).
      Parameters:
      validUntil - the date until the token is valid
    • create

      NewAccessToken create()
      Create the token. The user visible value of the token should be retrieved through NewAccessToken.getPlainTextValue().
      Returns:
      the created token