CreateThirdAppAccessToken
Creates a time-limited static access token for a specified user in the current account to access a single cloud desktop.
Operation description
When you call this operation, you must provide Resource and specify both ResourceType and ResourceId. Only a single cloud desktop is supported. You cannot omit Resource to authorize or query all cloud desktops.
AuthorizerId is the WyId of the user and cannot be replaced by a username. BusinessChannel supports Enterprise and Business. If omitted, the default value is Enterprise.
Before creation, the user must belong to the current calling account and have access permissions to the target cloud desktop. This operation only creates an access token. It does not create users or add authorization relationships between users and cloud desktops. Each successful call creates a new time-limited token. To obtain an existing token, call GetLatestThirdAppAccessToken and pass the same AuthorizerId and Resource.
The unit of Expiration is seconds. Valid values: 1 to 15552000. If omitted, the default value is 15552000, which equals 180 days. Permanent validity is not supported. Keep the returned AccessToken secure and avoid displaying the full token in logs or public content.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AuthorizerId |
string |
Yes |
The WyId of the authorized user. The user must belong to the current calling account. This parameter is not the username. |
f1e2d3c4b5a6**** |
| Resource |
object |
No |
The convenience username in the current tenant. Used when AuthorizerId is not provided or is empty. |
test |
| ResourceType |
string |
No |
The resource type. This parameter is required when you call this operation. Set the value to DESKTOP, which indicates a cloud desktop. The value is case-insensitive. |
DESKTOP |
| ResourceId |
string |
No |
The ID of the target cloud desktop. You must provide a non-empty value when you call this operation. Asterisks (*) are not allowed. The cloud desktop must be authorized to the user specified by AuthorizerId. |
ecd-7a8b9c0d**** |
| BusinessChannel |
string |
No |
The target single cloud desktop resource. You must provide this object along with ResourceType and ResourceId when you call this operation. Pass it as a JSON object to specify only one cloud desktop. Wildcards or authorization for all cloud desktops are not supported. |
Enterprise |
| Expiration |
integer |
No |
The business channel. Valid values: Enterprise and Business. The value is case-insensitive. If omitted, the default value is Enterprise. If an empty string or other values are explicitly passed, a parameter error is returned. This parameter does not replace user identity verification. |
Enterprise |
Pass Resource as a JSON object, for example: {"ResourceType":"DESKTOP","ResourceId":"ecd-7a8b9c0d****"}. The WyId, cloud desktop ID, and token in the example are desensitized display values. Replace them with valid values under the current account when you make actual calls.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The access token and expiration information returned when the call is successful. |
||
| RequestId |
string |
The unique identifier of the request. You can use it to locate and troubleshoot issues. |
6DAB2D15-7345-4C33-9D77-48A1A756B9E1 |
| AccessToken |
string |
The time-limited static access token created for the specified user and single cloud desktop. This is a sensitive credential. Do not log or disclose the full value. |
taatv1.v2**** |
| ExpiresAt |
integer |
The absolute expiration time of the token, in UNIX milliseconds. This parameter is not empty when the call is successful. GetLatestThirdAppAccessToken returns the original expiration time and does not extend it. |
1795450500000 |
AccessToken is a sensitive credential. The example is masked and cannot be used. ExpiresAt is a synthetic UNIX millisecond timestamp example and does not represent the return value of an actual request.
Examples
Success response
JSON format
{
"RequestId": "6DAB2D15-7345-4C33-9D77-48A1A756B9E1",
"AccessToken": "taatv1.v2****",
"ExpiresAt": 1795450500000
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.