public class TokenUpdateRequest extends Object implements Serializable
/auth/token/update API.
The API is used to update an existing access token.
accessTokenAn existing access token.
accessTokenExpiresAtA new date at which the access token will expire in milliseconds since the Unix epoch (1970-01-01). If the
accessTokenExpiresAtrequest parameter is not included in a request or its value is 0 (or negative), the expiration date of the access token is not changed.scopesA new set of scopes assigned to the access token. Scopes that are not supported by the service and those that the client application associated with the access token is not allowed to request are ignored on the server side. If the
scopesrequest parameter is not included in a request or its value isnull, the scopes of the access token are not changed.propertiesA new set of properties assigned to the access token. If the
propertiesrequest parameter is not included in a request or its value isnull, the properties of the access token are not changed.accessTokenExpiresAtUpdatedOnScopeUpdateA boolean request parameter which indicates whether the API attempts to update the expiration date of the access token when the scopes linked to the access token are changed by this request. The default value is
false. For more details, see the description ofsetAccessTokenExpiresAtUpdatedOnScopeUpdate(boolean).accessTokenHashThe hash of the access token value. Used when the hash of the token is known (perhaps from lookup) but the value of the token itself is not.
The value of the
accessTokenparameter takes precedence.accessTokenValueUpdatedA boolean request parameter which indicates whether to update the value of the access token in the data store. If this parameter is set to
truethen a new access token value is generated by the server and returned in the response. The default value isfalseand the access token's previous value is retained.
TokenUpdateResponse,
Serialized Form| Constructor and Description |
|---|
TokenUpdateRequest() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessToken()
Get the access token to update.
|
long |
getAccessTokenExpiresAt()
Get the new date at which the access token will expire.
|
String |
getAccessTokenHash()
Get the hash of the access token value.
|
Property[] |
getProperties()
Get a new set of properties assigned to the access token.
|
String[] |
getScopes()
Get the new set of scopes assigned to the access token.
|
boolean |
isAccessTokenExpiresAtUpdatedOnScopeUpdate()
Get the flag which indicates whether
/auth/token/update API attempts
to update the expiration date of the access token when the scopes linked to
the access token are changed by this request. |
boolean |
isAccessTokenPersistent()
Get whether the access token expires or not.
|
boolean |
isAccessTokenValueUpdated()
Get whether to update the value of the access token in the data store.
|
TokenUpdateRequest |
setAccessToken(String accessToken)
Set an existing access token to update.
|
TokenUpdateRequest |
setAccessTokenExpiresAt(long expiresAt)
Set the new date at which the access token will expire.
|
TokenUpdateRequest |
setAccessTokenExpiresAtUpdatedOnScopeUpdate(boolean updated)
Set the flag which indicates whether
/auth/token/update API attempts
to update the expiration date of the access token when the scopes linked to
the access token are changed by this request. |
TokenUpdateRequest |
setAccessTokenHash(String accessTokenHash)
Set the hash of the access token value.
|
TokenUpdateRequest |
setAccessTokenPersistent(boolean persistent)
Set whether the access token expires or not.
|
TokenUpdateRequest |
setAccessTokenValueUpdated(boolean updated)
Set whether to update the value of the access token in the data store.
|
TokenUpdateRequest |
setProperties(Property[] properties)
Set a new set of properties assigned to the access token.
|
TokenUpdateRequest |
setScopes(String[] scopes)
Set a new set of scopes assigned to the access token.
|
public String getAccessToken()
public TokenUpdateRequest setAccessToken(String accessToken)
accessToken - An existing access token to update.this object.public long getAccessTokenExpiresAt()
public TokenUpdateRequest setAccessTokenExpiresAt(long expiresAt)
If 0 or a negative value is given, the expiration date of the access token is not changed.
expiresAt - The new expiration date in milliseconds since the Unix epoch (1970-01-01).this object.public String[] getScopes()
public TokenUpdateRequest setScopes(String[] scopes)
If null is given, the scope set associated with the access token
is not changed.
scopes - A new set of scopes. null means that scopes are not changed.this object.public Property[] getProperties()
public TokenUpdateRequest setProperties(Property[] properties)
If null is given, the property set associated with the access token
is not changed.
properties - A new set of properties. null means that properties are not changed.this object.public boolean isAccessTokenExpiresAtUpdatedOnScopeUpdate()
/auth/token/update API attempts
to update the expiration date of the access token when the scopes linked to
the access token are changed by this request./auth/token/update API
attempts to update the expiration date of the access token when
the scopes linked to the access token are changed by this request.public TokenUpdateRequest setAccessTokenExpiresAtUpdatedOnScopeUpdate(boolean updated)
/auth/token/update API attempts
to update the expiration date of the access token when the scopes linked to
the access token are changed by this request. This request parameter is optional
and its default value is false. If this request parameter is set
to true and all of the following conditions are satisfied, the API
performs an update on the expiration date of the access token even if the
accessTokenExpiresAt request parameter is not explicitly specified
in the request.
accessTokenExpiresAt request parameter is not included
in the request or its value is 0 (or negative).
scopes
request parameter in the request.
When multiple access token duration values are found in the attributes of the specified scopes, the smallest value among them is used.
For more details, see the following examples.
Example 1.
Let's say we send the following request to /auth/token/update API
{
"accessToken" : "JDGiiM9PuWT63FIwGjG9eYlGi-aZMq6CQ2IB475JUxs",
"scopes" : ["read_profile"]
}
and "read_profile" has the following attributes.
{
"key" : "access_token.duration",
"value" : "10000"
}
In this case, the API evaluates "10000" as a new value of the
duration of the access token (in seconds) and updates the expiration date
of the access token using the duration.
Let's say we send the following request to /auth/token/update API
{
"accessToken" : "JDGiiM9PuWT63FIwGjG9eYlGi-aZMq6CQ2IB475JUxs",
"scopes" : ["read_profile", "write_profile"]
}
and "read_profile" has the following attributes
{
"key" : "access_token.duration",
"value" : "10000"
}
and "write_profile" has the following attributes.
{
"key" : "access_token.duration",
"value" : "5000"
}
In this case, the API evaluates "10000" and "5000"
as candidate values for new duration of the access token (in seconds) and
chooses the smallest value of them (i.e. "5000" is adopted) and updates the
expiration date of the access token using the duration.
updated - The flag which indicates whether /auth/token/update API
attempts to update the expiration date of the access token when
the scopes linked to the access token are changed by this request.this object.public boolean isAccessTokenPersistent()
true then the access token will not automatically
expire and must be revoked or deleted manually at the service.
If this request parameter is true, the accessTokenExpiresAt
request parameter is ignored. If this request parameter is false,
the accessTokenExpiresAt request parameter is processed normally.
false if the access token expires (default).
true if the access token does not expire.public TokenUpdateRequest setAccessTokenPersistent(boolean persistent)
true then the access token will not automatically
expire and must be revoked or deleted manually at the service.
If this request parameter is true, the accessTokenExpiresAt
request parameter is ignored. If this request parameter is false,
the accessTokenExpiresAt request parameter is processed normally.
persistent - false to make the access token expire (default).
true to make the access token be persistent.this object.public String getAccessTokenHash()
The value of the accessToken parameter takes precedence.
public TokenUpdateRequest setAccessTokenHash(String accessTokenHash)
The value of the accessToken parameter takes precedence.
accessTokenHash - The hash of the access token value.this object.public boolean isAccessTokenValueUpdated()
true then a new access token value is
generated by the server and returned in the response.false to keep the access token's current value (default).
true to have the server update the access token's value.public TokenUpdateRequest setAccessTokenValueUpdated(boolean updated)
true then a new access token value is
generated by the server and returned in the response.updated - false to keep the access token's current value (default).
true to have the server update the access token's value.this object.Copyright © 2019. All rights reserved.