Class OAuthCallbackKey

java.lang.Object
org.localify.user.support.OAuthCallbackKey

@Entity public class OAuthCallbackKey extends Object
Represents an OAuth callback key.
  • Constructor Details

    • OAuthCallbackKey

      protected OAuthCallbackKey()
      Default constructor.
    • OAuthCallbackKey

      public OAuthCallbackKey(byte[] id, byte[] state, User user)
      Creates a new OAuth callback key.
      Parameters:
      id - The ID of the key.
      state - The state of the key.
      user - The user associated with the key.
  • Method Details

    • getId

      public byte[] getId()
      Gets the ID of the key.
      Returns:
      The ID.
    • getIdAsString

      public String getIdAsString()
      Gets the ID of the key as a URL-safe Base64 string.
      Returns:
      The ID as a string.
    • getState

      public byte[] getState()
      Gets the state of the key.
      Returns:
      The state.
    • isConsumed

      public Boolean isConsumed()
      Checks if the key has been consumed.
      Returns:
      true if the key has been consumed, false otherwise.
    • getUser

      public User getUser()
      Gets the user associated with the key.
      Returns:
      The user.
    • consume

      public void consume()
      Marks the key as consumed.
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp of the key.
      Returns:
      The creation timestamp.
    • getConsumedAt

      public Instant getConsumedAt()
      Gets the consumption timestamp of the key.
      Returns:
      The consumption timestamp.
    • setState

      public void setState(byte[] state)
      Sets the state of the key.
      Parameters:
      state - The state.