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 AuthzDetailsgetAuthorizationDetails()Get the authorization details associated with the token.URIgetClientEntityId()Get the entity ID of the client.longgetClientId()Get the client ID.StringgetClientIdAlias()Get the alias of the client ID.longgetExpiresAt()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.StringgetSubject()Get the subject (= resource owner's unique identifier).booleanisClientEntityIdUsed()Get the flag which indicates whether the entity ID of the client was used when the request for the token was made.booleanisClientIdAliasUsed()Get the flag indicating whether the alias of the client ID was used when the token was created.TokenInfosetAuthorizationDetails(AuthzDetails details)Set the authorization details associated with the token.TokenInfosetClientEntityId(URI entityId)Set the entity ID of the client.TokenInfosetClientEntityIdUsed(boolean used)Set the flag which indicates whether the entity ID of the client was used when the request for the token was made.TokenInfosetClientId(long clientId)Set the client ID.TokenInfosetClientIdAlias(String alias)Set the alias of the client ID.TokenInfosetClientIdAliasUsed(boolean used)Set the flag indicating whether the alias of the client ID was used when the token was created.TokenInfosetExpiresAt(long expiresAt)Set the expiration date/time in seconds since the Unix epoch.TokenInfosetProperties(Property[] properties)Set the extra properties associated with the token.TokenInfosetResources(URI[] resources)Set the resources associated with the token.TokenInfosetScopes(Scope[] scopes)Set the scopes.TokenInfosetSubject(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:
thisinstance.
-
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:
thisinstance.
-
getScopes
public Scope[] getScopes()
Get the scopes.- Returns:
- The scopes.
-
setScopes
public TokenInfo setScopes(Scope[] scopes)
Set the scopes.- Parameters:
scopes- The scopes.- Returns:
thisinstance.
-
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:
thisinstance.
-
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:
thisinstance.- 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:
thisinstance.- 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:
trueif 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-trueto indicate that the alias of the client ID was used.- Returns:
thisinstance.- 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:
thisobject.- 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:
trueif 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-trueto indicate that the entity ID of the client was used when the request for the token was made.- Returns:
thisobject.- 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
resourcerequest 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
resourcerequest parameters.- Parameters:
resources- The resources.- Returns:
thisinstance.- 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_detailsrequest 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_detailsrequest parameter.- Parameters:
details- The authorization details.- Returns:
thisinstance.- See Also:
- RFC 9396 OAuth 2.0 Rich Authorization Requests
-
-