Class TokenInfo
- java.lang.Object
-
- com.authlete.common.dto.TokenInfo
-
- All Implemented Interfaces:
Serializable
public class TokenInfo extends Object implements Serializable
Information about a token of the type"urn:ietf:params:oauth:token-type:access_token"
or the type"urn:ietf:params:oauth:token-type:refresh_token"
.This class is used to hold detailed information about a subject token or an actor token. See the descriptions of
TokenResponse.getSubjectTokenInfo()
andTokenResponse.getActorTokenInfo()
for details.- Since:
- 3.26, Authlete 2.3
- See Also:
TokenResponse.getSubjectTokenInfo()
,TokenResponse.getActorTokenInfo()
, RFC 8693 OAuth 2.0 Token Exchange, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TokenInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthzDetails
getAuthorizationDetails()
Get the authorization details associated with the token.URI
getClientEntityId()
Get the entity ID of the client.long
getClientId()
Get the client ID.String
getClientIdAlias()
Get the alias of the client ID.long
getExpiresAt()
Get the expiration date/time in seconds since the Unix epoch.Property[]
getProperties()
Get the extra properties associated with the token.URI[]
getResources()
Get the resources associated with the token.Scope[]
getScopes()
Get the scopes.String
getSubject()
Get the subject (= resource owner's unique identifier).boolean
isClientEntityIdUsed()
Get the flag which indicates whether the entity ID of the client was used when the request for the token was made.boolean
isClientIdAliasUsed()
Get the flag indicating whether the alias of the client ID was used when the token was created.TokenInfo
setAuthorizationDetails(AuthzDetails details)
Set the authorization details associated with the token.TokenInfo
setClientEntityId(URI entityId)
Set the entity ID of the client.TokenInfo
setClientEntityIdUsed(boolean used)
Set the flag which indicates whether the entity ID of the client was used when the request for the token was made.TokenInfo
setClientId(long clientId)
Set the client ID.TokenInfo
setClientIdAlias(String alias)
Set the alias of the client ID.TokenInfo
setClientIdAliasUsed(boolean used)
Set the flag indicating whether the alias of the client ID was used when the token was created.TokenInfo
setExpiresAt(long expiresAt)
Set the expiration date/time in seconds since the Unix epoch.TokenInfo
setProperties(Property[] properties)
Set the extra properties associated with the token.TokenInfo
setResources(URI[] resources)
Set the resources associated with the token.TokenInfo
setScopes(Scope[] scopes)
Set the scopes.TokenInfo
setSubject(String subject)
Set the subject (= resource owner's unique identifier).
-
-
-
Method Detail
-
getClientId
public long getClientId()
Get the client ID.- Returns:
- The client ID.
-
setClientId
public TokenInfo setClientId(long clientId)
Set the client ID.- Parameters:
clientId
- The client ID.- Returns:
this
instance.
-
getSubject
public String getSubject()
Get the subject (= resource owner's unique identifier).- Returns:
- The subject.
-
setSubject
public TokenInfo setSubject(String subject)
Set the subject (= resource owner's unique identifier).- Parameters:
subject
- The subject.- Returns:
this
instance.
-
getScopes
public Scope[] getScopes()
Get the scopes.- Returns:
- The scopes.
-
setScopes
public TokenInfo setScopes(Scope[] scopes)
Set the scopes.- Parameters:
scopes
- The scopes.- Returns:
this
instance.
-
getExpiresAt
public long getExpiresAt()
Get the expiration date/time in seconds since the Unix epoch.- Returns:
- The expiration date/time.
-
setExpiresAt
public TokenInfo setExpiresAt(long expiresAt)
Set the expiration date/time in seconds since the Unix epoch.- Parameters:
expiresAt
- The expiration date/time.- Returns:
this
instance.
-
getProperties
public Property[] getProperties()
Get the extra properties associated with the token.- Returns:
- The extra properties.
- See Also:
- Extra Properties, How to add extra properties to an access token - Authlete Knowledge Base
-
setProperties
public TokenInfo setProperties(Property[] properties)
Set the extra properties associated with the token.- Parameters:
properties
- The extra properties.- Returns:
this
instance.- See Also:
- Extra Properties, How to add extra properties to an access token - Authlete Knowledge Base
-
getClientIdAlias
public String getClientIdAlias()
Get the alias of the client ID.- Returns:
- The alias of the client ID.
- See Also:
- Using "Client ID Alias" - Authlete Knowledge Base
-
setClientIdAlias
public TokenInfo setClientIdAlias(String alias)
Set the alias of the client ID.- Parameters:
alias
- The alias of the client ID.- Returns:
this
instance.- See Also:
- Using "Client ID Alias" - Authlete Knowledge Base
-
isClientIdAliasUsed
public boolean isClientIdAliasUsed()
Get the flag indicating whether the alias of the client ID was used when the token was created.- Returns:
true
if the alias of the client ID was used.- See Also:
- Using "Client ID Alias" - Authlete Knowledge Base
-
setClientIdAliasUsed
public TokenInfo setClientIdAliasUsed(boolean used)
Set the flag indicating whether the alias of the client ID was used when the token was created.- Parameters:
used
-true
to indicate that the alias of the client ID was used.- Returns:
this
instance.- See Also:
- Using "Client ID Alias" - Authlete Knowledge Base
-
getClientEntityId
public URI getClientEntityId()
Get the entity ID of the client."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Returns:
- The entity ID of the client.
- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
setClientEntityId
public TokenInfo setClientEntityId(URI entityId)
Set the entity ID of the client."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Parameters:
entityId
- The entity ID of the client.- Returns:
this
object.- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
isClientEntityIdUsed
public boolean isClientEntityIdUsed()
Get the flag which indicates whether the entity ID of the client was used when the request for the token was made."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Returns:
true
if the entity ID of the client was used when the request for the token was made.- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
setClientEntityIdUsed
public TokenInfo setClientEntityIdUsed(boolean used)
Set the flag which indicates whether the entity ID of the client was used when the request for the token was made."Entity ID" is a technical term defined in OpenID Federation 1.0.
- Parameters:
used
-true
to indicate that the entity ID of the client was used when the request for the token was made.- Returns:
this
object.- Since:
- 3.37, Authlete 2.3
- See Also:
- OpenID Federation 1.0
-
getResources
public URI[] getResources()
Get the resources associated with the token.The values are ones specified by the
resource
request parameters.- Returns:
- The resources.
- See Also:
- RFC 8707 Resource Indicators for OAuth 2.0
-
setResources
public TokenInfo setResources(URI[] resources)
Set the resources associated with the token.The values are ones specified by the
resource
request parameters.- Parameters:
resources
- The resources.- Returns:
this
instance.- See Also:
- RFC 8707 Resource Indicators for OAuth 2.0
-
getAuthorizationDetails
public AuthzDetails getAuthorizationDetails()
Get the authorization details associated with the token.The value is one specified by the
authorization_details
request parameter.- Returns:
- The authorization details.
- See Also:
- RFC 9396 OAuth 2.0 Rich Authorization Requests
-
setAuthorizationDetails
public TokenInfo setAuthorizationDetails(AuthzDetails details)
Set the authorization details associated with the token.The value is one specified by the
authorization_details
request parameter.- Parameters:
details
- The authorization details.- Returns:
this
instance.- See Also:
- RFC 9396 OAuth 2.0 Rich Authorization Requests
-
-