public class TokenCreateRequest extends Object implements Serializable
/auth/token/create API.
The API is used to create an arbitrary access token in a special way that is different from standard grant flows.
grantType(REQUIRED)The grant type for a newly created access token. One of the following.
REFRESH_TOKENis not allowed.When
grantTypeis eitherIMPLICITorCLIENT_CREDENTIALS, a refresh token is not issued.clientId(REQUIRED)The ID of the client application which will be associated with a newly created access token.
subject(CONDITIONALLY REQUIRED)The subject (= unique identifier) of the user who will be associated with a newly created access token. This parameter is required unless the grant type is
CLIENT_CREDENTIALS. The value must consist of only ASCII characters and its length must not exceed 100.scopes(OPTIONAL)The scopes which will be associated with a newly created access token. Scopes that are not supported by the service cannot be specified and requesting them will cause an error.
accessTokenDuration(OPTIONAL)The duration of a newly created access token in seconds. If the value is 0, the duration is determined according to the settings of the service.
refreshTokenDuration(OPTIONAL)The duration of a newly created refresh token in seconds. If the value is 0, the duration is determined according to the settings of the service.
A refresh token is not created (1) if the service does not support
REFRESH_TOKEN, or (2) if the specified grant type is eitherIMPLICITorCLIENT_CREDENTIALS.
TokenCreateResponse,
Serialized Form| Constructor and Description |
|---|
TokenCreateRequest() |
| Modifier and Type | Method and Description |
|---|---|
long |
getAccessTokenDuration()
Get the duration of a newly created access token in seconds.
|
long |
getClientId()
Get the client ID that will be associated with a newly created
access token.
|
GrantType |
getGrantType()
Get the grant type for a newly created access token.
|
long |
getRefreshTokenDuration()
Get the duration of a newly created refresh token in seconds.
|
String[] |
getScopes()
Get the scopes that will be associated with a newly created
access token.
|
String |
getSubject()
Get the subject (= unique identifier) of the user who will be
associated with a newly created access token.
|
TokenCreateRequest |
setAccessTokenDuration(long accessTokenDuration)
Set the duration of a newly created access token in seconds.
|
TokenCreateRequest |
setClientId(long clientId)
Set the client ID that will be associated with a newly created
access token.
|
TokenCreateRequest |
setGrantType(GrantType grantType)
Set the grant type for a newly created access token.
|
TokenCreateRequest |
setRefreshTokenDuration(long refreshTokenDuration)
Set the duration of a newly created refresh token in seconds.
|
TokenCreateRequest |
setScopes(String[] scopes)
Set the scopes that will be associated with a newly created
access token.
|
TokenCreateRequest |
setSubject(String subject)
Set the subject (= unique identifier) of the user who will be
associated with a newly created access token.
|
public GrantType getGrantType()
public TokenCreateRequest setGrantType(GrantType grantType)
grantType - Grant type.this object.public long getClientId()
public TokenCreateRequest setClientId(long clientId)
clientId - Client ID.this object.public String getSubject()
public TokenCreateRequest setSubject(String subject)
subject - The subject of the user.this object.public String[] getScopes()
public TokenCreateRequest setScopes(String[] scopes)
scopes - Scopes.this object.public long getAccessTokenDuration()
public TokenCreateRequest setAccessTokenDuration(long accessTokenDuration)
accessTokenDuration - The duration of a newly created access token.this object.public long getRefreshTokenDuration()
public TokenCreateRequest setRefreshTokenDuration(long refreshTokenDuration)
refreshTokenDuration - The duration of a newly created refresh token.this object.Copyright © 2015. All rights reserved.