TokenAnonymous
Region:
China (Beijing)
Request Parameters
Required
domain_id
grant_typeThe method that is ...
codeThe authorization c...
redirect_uriThe redirect URI th...
client_idThe AppId of the ap...
client_secretThe AppSecret of th...
refresh_tokenThe refresh token t...
assertionThe JWT assertion t...
Plugin DownloadLearn more
VS Code Plugin
Before installing the plugin, please install VS CodeBefore installing the plugin, please install VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains Plugin
Before installing the plugin, please install JetBrains IDEBefore installing the plugin, please install JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

Operation Description

For more information about how to access Drive and Photo Service from a web server application by using OAuth 2.0, visit OAuth 2.0 For Web Server Applications.

For more information about how to access Drive and Photo Service by using a JSON Web Token (JWT) application, visit Access process for JWT applications.

Request Syntax

POST /v2/oauth/token HTTP/1.1

Request Parameters

Field NameField Details
domain_idstring
grant_typestring

The method that is used to generate an access token. Valid values:View Details...

Example:refresh_token
codestring

The authorization code in the redirect URI that is specified after the authorization process is complete. This parameter is required if grant_type is set to authorization_code.

Example:0045157fa8e24f4f9a0d9e3ff158c1e0
redirect_uristring

The redirect URI that is specified when you initiate the authorization request. This parameter is required if grant_type is set to authorization_code.

Example:https://aliyun.com/pds
client_idstring

The AppId of the application that is created in the Drive and Photo Service console.

Example:1Zu***flH
client_secretstring

The AppSecret of the application that is created in the Drive and Photo Service console. This parameter is required if the application is of the WebServer type.

Example:80D***3i5
refresh_tokenstring

The refresh token that is used to refresh the access token. This parameter is required if grant_type is set to refresh_token.

Example:399623e13353490391266c7d48a13ed1
assertionstring

The JWT assertion that is signed by using the JWT private key. The JWT assertion contains the information about the user to be authorized and the authorization parameters. For more information about the structure of the JWT assertion, see JWTPayload. This parameter is required if grant_type is set to urn:ietf:params:oauth:grant-type:jwt-bearer.

Example:ey***asd

Response Parameters

Field NameField Details
access_tokenstring

The access token.

Example:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjOWI3YTVhYTA0ZDE0YWUzODY3ZmRjODg2ZmEwMWRhNCIsImN1c3RvbUpzb24iOiJ7XCJjbGllbnRJZFwiOlwiMjVkelgzdmJZcWt0Vnh5WFwiLFwiZG9tYWluSWRcIjpcImJqMjlcIixcInNjb3BlXCI6W1wiRFJJVkUuQUxMXCIsXCJTSEFSRS5BTExcIixcIkZJTEUuQUxMXCIsXCJVU0VSLkFMTFwiLFwiVklFVy5BTExcIixcIlNUT1JBR0UuQUxMXCIsXCJTVE9SQUdFRklMRS5MSVNUXCIsXCJCQVRDSFwiLFwiT0FVVEguQUxMXCIsXCJJTUFHRS5BTExcIixcIklOVklURS5BTExcIixcIkFDQ09VTlQuQUxMXCJdLFwicm9sZVwiOlwidXNlclwiLFwicmVmXCI6XCJodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vXCIsXCJkZXZpY2VfaWRcIjpcImIyODIwNWU1YzU5NzRjY2JiODI3MDNiNjhkYjhjNDUxXCJ9IiwiZXhwIjoxNjQ4NjE0NDkzLCJpYXQiOjE2NDg2MDcyMzN9.d3HVLvv_LFw2QhPrhvjH_kICWQJX9sKKt7NjQEqI_xE2JO_b7D8rPsFTZz93PLvZ7MhCmudTjGImUpd-ehFnI4Go-1S7BGaKaHFILvP-sWy18Wpikowjxx9mSbzBM_cO6D1LI-kyYhXKWHgVdADfVIPniTDA7-ffhUpi7cAebEs
refresh_tokenstring

The refresh token.

Example:060e78d36afb4879b51e4264e9541c16
expires_ininteger<int64>

The validity period of the token.

Notice Please note that this value is of type Long, and there may be a risk of loss of precision in some languages. Please use it with caution.
Example:3600
token_typestring

The type of the token.View Details...

Example:BearerEnumeration Value:Bearer
user_idstring

The user ID.

Example:DING-xxxxx
user_namestring

The name of the user.

Example:pdsuser
avatarstring

The profile picture of the user.

Example:aliyunpds.com/a.jpg
nick_namestring

The nickname of the user.

Example:pdsuser
default_drive_idstring

The ID of the default space of the user.

Example:1
rolestring

The role of the user.

Example:admin
statusstring

The status of the user.

Example:enabled
expire_timestring

The time when the credential expires.

Example:2019-09-01T06:57:48.813Z
is_first_loginboolean

Indicates whether this is the first logon of the user.

Example:false
device_idstring

The ID of the device that is bound to OAuth 2.0 Device Authorization Grant.

Example:8574ecc3d4904dc095cc49202e74db94
device_namestring

The name of the device that is bound to OAuth 2.0 Device Authorization Grant.

Example:4683C25F
domain_idstring

The domain ID.

Example:bj1
Change History
No Change History found.