Obtains an access token as part of the OAuth 2.0 authorization flow.
Operation description
For more information, see the user guide.
For details on JWT-based logon, see JWT-based logon.
Try it now
Test
RAM authorization
Request syntax
POST /v2/oauth/token HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| domain_id |
string |
Yes |
||
| grant_type |
string |
Yes |
The grant type. Valid values:
|
refresh_token |
| code |
string |
No |
The authorization code returned in the redirect URI after successful authentication. This parameter is required when |
0045157fa8e24f4f9a0d9e3ff158c1e0 |
| redirect_uri |
string |
No |
The redirect URI used in the authorization request. This parameter is required when |
https://aliyun.com/pds |
| client_id |
string |
Yes |
The ID of the app you create in the Alibaba Cloud PDS console. |
1Zu***flH |
| client_secret |
string |
No |
The secret of the app you create in the Alibaba Cloud PDS console. This parameter is required for WebServer applications. |
80D***3i5 |
| refresh_token |
string |
No |
The token used to refresh an access token. This parameter is required when |
399623e13353490391266c7d48a13ed1 |
| assertion |
string |
No |
A JWT-signed string that contains user information and authorization parameters to be granted. For the structure, see JWTPayload. This parameter is required when |
ey***asd |
Response elements
|
Element |
Type |
Description |
Example |
| Token |
Contains details about the access token. |
Examples
Success response
JSON format
{
"access_token": "",
"refresh_token": "",
"expires_in": 0,
"token_type": "",
"user_id": "",
"user_name": "",
"avatar": "",
"nick_name": "",
"default_drive_id": "",
"role": "",
"status": "",
"expire_time": "",
"is_first_login": true,
"device_id": "",
"device_name": "",
"domain_id": "",
"default_sbox_drive_id": "",
"user_data": {
"key": ""
},
"pin_setup": true,
"need_rp_verify": true,
"state": "",
"exist_link": [
{
"type": "",
"identity": "",
"extra": ""
}
],
"need_link": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.