Record Class OAuthPrincipal
java.lang.Object
java.lang.Record
dev.relism.flash.ext.security.oauthserver.OAuthPrincipal
- Record Components:
claims- the token's verified claims
- All Implemented Interfaces:
dev.relism.flash.ext.security.Principal
public record OAuthPrincipal(String name, String clientId, Map<String,Object> claims)
extends Record
implements dev.relism.flash.ext.security.Principal
A caller holding an access token this application issued.
name() is sub: the
OAuthSubject.id() the user authorized as, or the client's own id for client_credentials.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclaims()Returns the value of theclaimsrecord component.clientId()Returns the value of theclientIdrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanhasAudience(String audience) final inthashCode()Returns a hash code value for this object.booleanname()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.relism.flash.ext.security.Principal
logoutUrl
-
Constructor Details
-
OAuthPrincipal
Creates an instance of aOAuthPrincipalrecord class.- Parameters:
name- the value for thenamerecord componentclientId- the value for theclientIdrecord componentclaims- the value for theclaimsrecord component
-
-
Method Details
-
claim
-
hasScope
- Specified by:
hasScopein interfacedev.relism.flash.ext.security.Principal
-
hasAudience
- Specified by:
hasAudiencein interfacedev.relism.flash.ext.security.Principal
-
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). -
name
Returns the value of thenamerecord component.- Specified by:
namein interfacedev.relism.flash.ext.security.Principal- Returns:
- the value of the
namerecord component
-
clientId
Returns the value of theclientIdrecord component.- Returns:
- the value of the
clientIdrecord component
-
claims
Returns the value of theclaimsrecord component.- Returns:
- the value of the
claimsrecord component
-