Class OAuth2TokenDescriptor
java.lang.Object
com.linecorp.armeria.common.auth.oauth2.OAuth2TokenDescriptor
- All Implemented Interfaces:
Serializable
Defines a structure of the Token Introspection Response, as per
[RFC7662], Section 2.2.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaudience()
"aud" Token Introspection Response field, OPTIONAL.static OAuth2TokenDescriptorBuilder
builder
(boolean active) Creates a newOAuth2TokenDescriptorBuilder
to build a newOAuth2TokenDescriptor
and supplied it with a value ofactive
Token Introspection Response field.clientId()
"client_id" Token Introspection Response field, OPTIONAL.boolean
"exp" Token Introspection Response field, OPTIONAL.Duration
indicating the lifetime of the access token.extras()
AMap
of extra system-specific token parameters included with Token Introspection Response, OPTIONAL.int
hashCode()
boolean
isActive()
"active" Token Introspection Response field, REQUIRED.boolean
Indicates whether or not the Token used prematurely based onnotBefore()
function.issuedAt()
"iat" Token Introspection Response field, OPTIONAL.issuer()
"iss" Token Introspection Response field, OPTIONAL.boolean
isValid()
Indicates whether or not the Token already expired based onexpiresAt()
function.boolean
Indicates whether or not the Token expire at the givenInstant
time based onexpiresAt()
function.jwtId()
"jti" Token Introspection Response field, OPTIONAL."nbf" Token Introspection Response field, OPTIONAL.static OAuth2TokenDescriptor
Creates a newOAuth2TokenDescriptor
based on theJSON
-formatted raw response body.JSON
-formatted raw Token Introspection Response body.scope()
"scope" Token Introspection Response field, OPTIONAL.scopeSet()
"scope" Token Introspection Response field, OPTIONAL.subject()
"sub" Token Introspection Response field, OPTIONAL."token_type" Token Introspection Response field, OPTIONAL.toString()
userName()
"username" Token Introspection Response field, OPTIONAL.
-
Method Details
-
parse
Creates a newOAuth2TokenDescriptor
based on theJSON
-formatted raw response body.- Parameters:
rawResponse
-JSON
-formatted raw response body.- Returns:
- A new instance of
OAuth2TokenDescriptor
.
-
builder
Creates a newOAuth2TokenDescriptorBuilder
to build a newOAuth2TokenDescriptor
and supplied it with a value ofactive
Token Introspection Response field.- Returns:
- A new instance of
OAuth2TokenDescriptorBuilder
.
-
isActive
public boolean isActive()"active" Token Introspection Response field, REQUIRED. Boolean indicator of whether or not the presented token is currently active. The specifics of a token's "active" state will vary depending on the implementation of the authorization server and the information it keeps about its tokens, but a "true" value return for the "active" property will generally indicate that a given token has been issued by this authorization server, has not been revoked by the resource owner, and is within its given time window of validity (e.g., after its issuance time and before its expiration time). -
isValid
Indicates whether or not the Token expire at the givenInstant
time based onexpiresAt()
function. -
isValid
public boolean isValid()Indicates whether or not the Token already expired based onexpiresAt()
function. -
isNotBefore
public boolean isNotBefore()Indicates whether or not the Token used prematurely based onnotBefore()
function. -
scope
"scope" Token Introspection Response field, OPTIONAL. A JSON string containing a space-separated list of scopes associated with this token, in the format described at [RFC6749], Section 3.3. -
scopeSet
"scope" Token Introspection Response field, OPTIONAL. ASet
of case-sensitive scope strings. The strings are defined by the authorization server. -
clientId
"client_id" Token Introspection Response field, OPTIONAL. Client identifier for the OAuth 2.0 client that requested this token. -
userName
"username" Token Introspection Response field, OPTIONAL. Human-readable identifier for the resource owner who authorized this token. -
tokenType
"token_type" Token Introspection Response field, OPTIONAL. Type of the token as defined at [RFC6749], Section 7.1. -
expiresAt
-
issuedAt
-
expiresIn
Duration
indicating the lifetime of the access token. The value is NOT supplied with the Token Introspection response and calculated based on "iat" and "exp" response fields every time this method invoked. -
notBefore
-
subject
"sub" Token Introspection Response field, OPTIONAL. Subject of the token. Usually a machine-readable identifier of the resource owner who authorized this token. As defined at [RFC7519]. -
audience
"aud" Token Introspection Response field, OPTIONAL. Service-specific string identifier or list of string identifiers representing the intended audience for this token, as defined at [RFC7519]. -
issuer
"iss" Token Introspection Response field, OPTIONAL. String representing the issuer of this token, as defined at [RFC7519]. -
jwtId
"jti" Token Introspection Response field, OPTIONAL. String identifier for the token - JWT ID, as defined at [RFC7519]. -
extras
AMap
of extra system-specific token parameters included with Token Introspection Response, OPTIONAL. -
rawResponse
JSON
-formatted raw Token Introspection Response body. If theOAuth2TokenDescriptor
was not parsed out of the raw response body, this value calculated based on the otherOAuth2TokenDescriptor
values. -
toString
-
equals
-
hashCode
public int hashCode()
-