Obtains an authorization code that contains user identity and permission information. The authorization code can be used to launch a cloud application in integration scenarios.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ExternalUserId |
string |
No |
The external user ID. This ID is defined by the caller and must be unique within an Alibaba Cloud account. This parameter and EndUserId cannot both be empty. |
alice |
| EndUserId |
string |
No |
The username of the China Desktop Service (China Desktop Service) convenience account. The username must be unique within an Alibaba Cloud account. This parameter and ExternalUserId cannot both be empty. |
alice |
| Policy |
string |
No |
The access policy that restricts the access permissions of the authorization code. If this parameter is left empty, no restrictions are applied. Syntax:
Valid values of
|
{ "Version": "1", "Resource": { "Type": "AppInstanceGroup", "Id": "aig-9ciijz60n4xsv****" } } |
| AutoCreateUser |
boolean |
No |
Specifies whether to synchronously create an EndUserId based on ExternalUserId. This parameter takes effect only when EndUserId is empty. Valid values:
|
false |
| TokenType |
string |
No |
||
| AccountType |
string |
No |
||
| AdDomain |
string |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
| AuthModel |
object |
The authorization code information. |
|
| AuthCode |
string |
The authorization code. The authorization code is valid for 3 minutes and can be used only once regardless of whether the verification succeeds or fails. If multiple authorization codes are generated for a user, only the last generated authorization code is valid. |
acv2ZEq2TNSqOlX+DvyetHGRT08iPhbWg/os1W4HojpBxkMQZkAnbKSfz/wNvS0E149IQZ5TogvBUE8ghCSVV+QBnv48Y+sn4z9fY5ywZA1peI5s4TplQI0TADBhPZXEIzMOdmbNsDGGlGcKOAq8ixd1Epzdu9XfvRzdLOO6o3zQwTZxXsjOgGBW8JTcgCP9W9iYiIjHIdZ2VCAnmMzuyVkyED8gymEevH10QoclyH/O3s8Yq6VF34gMXihDQeiI8PyiAZrW0JWXSWpdy3n4yGtAqMAgv46FzTA+XJ6C******** |
| EndUserId |
string |
The username of the China Desktop Service convenience account. |
alice |
| ExpireTime |
string |
The expiration time of the authorization code in UTC, following the ISO 8601 standard. |
2015-01-23T12:33:18Z |
Examples
Success response
JSON format
{
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
"AuthModel": {
"AuthCode": "acv2ZEq2TNSqOlX+DvyetHGRT08iPhbWg/os1W4HojpBxkMQZkAnbKSfz/wNvS0E149IQZ5TogvBUE8ghCSVV+QBnv48Y+sn4z9fY5ywZA1peI5s4TplQI0TADBhPZXEIzMOdmbNsDGGlGcKOAq8ixd1Epzdu9XfvRzdLOO6o3zQwTZxXsjOgGBW8JTcgCP9W9iYiIjHIdZ2VCAnmMzuyVkyED8gymEevH10QoclyH/O3s8Yq6VF34gMXihDQeiI8PyiAZrW0JWXSWpdy3n4yGtAqMAgv46FzTA+XJ6C********",
"EndUserId": "alice",
"ExpireTime": "2015-01-23T12:33:18Z"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.