Record Class TokenService.TokenPair

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.authentication.TokenService.TokenPair
Record Components:
accessToken - plain access token
accessExpiresAt - access-token expiry
refreshToken - plain refresh token
refreshExpiresAt - refresh-token expiry
subjectId - subject the pair authenticates
Enclosing class:
TokenService

public static record TokenService.TokenPair(String accessToken, Instant accessExpiresAt, String refreshToken, Instant refreshExpiresAt, SubjectId subjectId) extends Record
Returned from issue / rotate. Apps deliver both plain tokens to the client (typically in a JSON body) and discard them server-side.
  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • accessToken

      public String accessToken()
      Returns the value of the accessToken record component.
      Returns:
      the value of the accessToken record component
    • accessExpiresAt

      public Instant accessExpiresAt()
      Returns the value of the accessExpiresAt record component.
      Returns:
      the value of the accessExpiresAt record component
    • refreshToken

      public String refreshToken()
      Returns the value of the refreshToken record component.
      Returns:
      the value of the refreshToken record component
    • refreshExpiresAt

      public Instant refreshExpiresAt()
      Returns the value of the refreshExpiresAt record component.
      Returns:
      the value of the refreshExpiresAt record component
    • subjectId

      public SubjectId subjectId()
      Returns the value of the subjectId record component.
      Returns:
      the value of the subjectId record component