Package com.authlete.jaxrs
Class AccessTokenInfo
- java.lang.Object
-
- com.authlete.jaxrs.AccessTokenInfo
-
- All Implemented Interfaces:
Serializable
public class AccessTokenInfo extends Object implements Serializable
Information about an access token.- Since:
- 1.2
- Author:
- Takahiko Kawasaki
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AccessTokenInfo()The default constructor.AccessTokenInfo(String accessToken, com.authlete.common.dto.IntrospectionResponse info)A constructor with an access token and a response from Authlete's /api/auth/introspection API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessToken()Get the value of the access token.longgetClientId()Get the ID of the client application which is associated with the access token.longgetExpiresAt()Get the time at which the access token will expire.com.authlete.common.dto.Property[]getProperties()Get the extra properties associated with this access token.String[]getScopes()Get the scopes associated with the access token.StringgetSubject()Get the subject (= unique identifier) of the user who is associated with the access token.AccessTokenInfosetAccessToken(String accessToken)Set the value of the access token.AccessTokenInfosetClientId(long clientId)Set the ID of the client application which is associated with the access token.AccessTokenInfosetExpiresAt(long expiresAt)Set the time at which the access token will expire.AccessTokenInfosetProperties(com.authlete.common.dto.Property[] properties)Set the extra properties associated with the access token.AccessTokenInfosetScopes(String[] scopes)Set the scopes associated with the access token.AccessTokenInfosetSubject(String subject)Set the subject (= unique identifier) of the user who is associated with the access token.
-
-
-
Constructor Detail
-
AccessTokenInfo
public AccessTokenInfo()
The default constructor.
-
AccessTokenInfo
public AccessTokenInfo(String accessToken, com.authlete.common.dto.IntrospectionResponse info)
A constructor with an access token and a response from Authlete's /api/auth/introspection API.- Parameters:
accessToken- An access token.info- A response from Authlete's /api/auth/introspection API.- Since:
- 1.3
-
-
Method Detail
-
getAccessToken
public String getAccessToken()
Get the value of the access token.- Returns:
- The value of the access token.
-
setAccessToken
public AccessTokenInfo setAccessToken(String accessToken)
Set the value of the access token.- Parameters:
accessToken- The value of the access token.- Returns:
thisobject.- Since:
- 1.3
-
getClientId
public long getClientId()
Get the ID of the client application which is associated with the access token.- Returns:
- The client ID.
-
setClientId
public AccessTokenInfo setClientId(long clientId)
Set the ID of the client application which is associated with the access token.- Parameters:
clientId- The client ID.- Returns:
thisobject.- Since:
- 1.3
-
getSubject
public String getSubject()
Get the subject (= unique identifier) of the user who is associated with the access token. This method returnsnullif the access token was issued by Client Credentials Flow.- Returns:
- The subject (= unique identifier) of the user.
-
setSubject
public AccessTokenInfo setSubject(String subject)
Set the subject (= unique identifier) of the user who is associated with the access token.- Parameters:
subject- The subject (= unique identifier) of the user.- Returns:
thisobject.- Since:
- 1.3
-
getScopes
public String[] getScopes()
Get the scopes associated with the access token. This method returnsnullif no scope was requested when an access token was issued.- Returns:
- The scopes.
-
setScopes
public AccessTokenInfo setScopes(String[] scopes)
Set the scopes associated with the access token.- Parameters:
scopes- The scopes.- Returns:
thisobject.- Since:
- 1.3
-
getExpiresAt
public long getExpiresAt()
Get the time at which the access token will expire.- Returns:
- The time at which the access token will expire. Milliseconds since the Unix epoch (1970-01-01).
-
setExpiresAt
public AccessTokenInfo setExpiresAt(long expiresAt)
Set the time at which the access token will expire.- Parameters:
expiresAt- The time at which the access token will expire. Milliseconds since the Unix epoch (1970-01-01).- Returns:
thisobject.- Since:
- 1.3
-
getProperties
public com.authlete.common.dto.Property[] getProperties()
Get the extra properties associated with this access token.- Returns:
- Extra properties. When no extra properties are associated
with this access token,
nullis returned. - Since:
- 1.3
-
setProperties
public AccessTokenInfo setProperties(com.authlete.common.dto.Property[] properties)
Set the extra properties associated with the access token.- Parameters:
properties- Extra properties.- Returns:
thisobject.- Since:
- 1.3
-
-