Package org.localify.user.support
Class OAuthCallbackKey
java.lang.Object
org.localify.user.support.OAuthCallbackKey
Represents an OAuth callback key.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor.OAuthCallbackKey(byte[] id, byte[] state, User user) Creates a new OAuth callback key. -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume()Marks the key as consumed.Gets the consumption timestamp of the key.Gets the creation timestamp of the key.byte[]getId()Gets the ID of the key.Gets the ID of the key as a URL-safe Base64 string.byte[]getState()Gets the state of the key.getUser()Gets the user associated with the key.Checks if the key has been consumed.voidsetState(byte[] state) Sets the state of the key.
-
Constructor Details
-
OAuthCallbackKey
protected OAuthCallbackKey()Default constructor. -
OAuthCallbackKey
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
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
Checks if the key has been consumed.- Returns:
- true if the key has been consumed, false otherwise.
-
getUser
Gets the user associated with the key.- Returns:
- The user.
-
consume
public void consume()Marks the key as consumed. -
getCreatedAt
Gets the creation timestamp of the key.- Returns:
- The creation timestamp.
-
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.
-