Record Class OAuthGrant
java.lang.Object
java.lang.Record
dev.relism.flash.ext.security.oauthserver.OAuthGrant
- Record Components:
subject- who authorized it, asOAuthSubject.id()claims- carried into every access token issued from itredirectUri- the one the authorization request named, which the code exchange must repeat;nullotherwisechallenge- the PKCES256challenge; codes onlyusedAt- when it was exchanged,nullwhile it is unused
public record OAuthGrant(String hash, OAuthGrant.Kind kind, String family, String clientId, String subject, Map<String,Object> claims, String scope, String resource, String redirectUri, String challenge, Instant expiresAt, Instant usedAt)
extends Record
An authorization code or a refresh token, stored under the hash of its value. Every grant descending
from one authorization shares a
family, so a replayed code or a reused refresh token revokes
the whole of it (OAuth 2.1 §4.1.2, §4.3.1).-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thechallengerecord component.claims()Returns the value of theclaimsrecord component.clientId()Returns the value of theclientIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.family()Returns the value of thefamilyrecord component.hash()Returns the value of thehashrecord component.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.Returns the value of theredirectUrirecord component.resource()Returns the value of theresourcerecord component.scope()Returns the value of thescoperecord component.subject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.usedAt()Returns the value of theusedAtrecord component.
-
Constructor Details
-
OAuthGrant
public OAuthGrant(String hash, OAuthGrant.Kind kind, String family, String clientId, String subject, Map<String, Object> claims, String scope, String resource, String redirectUri, String challenge, Instant expiresAt, Instant usedAt) Creates an instance of aOAuthGrantrecord class.- Parameters:
hash- the value for thehashrecord componentkind- the value for thekindrecord componentfamily- the value for thefamilyrecord componentclientId- the value for theclientIdrecord componentsubject- the value for thesubjectrecord componentclaims- the value for theclaimsrecord componentscope- the value for thescoperecord componentresource- the value for theresourcerecord componentredirectUri- the value for theredirectUrirecord componentchallenge- the value for thechallengerecord componentexpiresAt- the value for theexpiresAtrecord componentusedAt- the value for theusedAtrecord component
-
-
Method Details
-
used
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
hash
Returns the value of thehashrecord component.- Returns:
- the value of the
hashrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
family
Returns the value of thefamilyrecord component.- Returns:
- the value of the
familyrecord component
-
clientId
Returns the value of theclientIdrecord component.- Returns:
- the value of the
clientIdrecord component
-
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
claims
Returns the value of theclaimsrecord component.- Returns:
- the value of the
claimsrecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
resource
Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
redirectUri
Returns the value of theredirectUrirecord component.- Returns:
- the value of the
redirectUrirecord component
-
challenge
Returns the value of thechallengerecord component.- Returns:
- the value of the
challengerecord component
-
expiresAt
Returns the value of theexpiresAtrecord component.- Returns:
- the value of the
expiresAtrecord component
-
usedAt
Returns the value of theusedAtrecord component.- Returns:
- the value of the
usedAtrecord component
-