Obtains a temporary account and password for logging on to an instance.

A temporary account and password is valid for one hour. If you log on to an instance by using Security Token Service (STS), you can access the instance resources within the validity period of an STS token.

  • If you log on to an instance by using the temporary password obtained through an Alibaba Cloud account, you have the same permissions on resources as the user of the Alibaba Cloud account.
  • If you log on to an instance by using the temporary password obtained through a RAM user, you have the same permissions as the RAM user.
  • If you log on to an instance by using the temporary password obtained through STS, you have the same permissions as the STS token.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetAuthorizationToken

The operation that you want to perform. Set the value to GetAuthorizationToken.

InstanceId String Yes cri-kmsiwlxxdcvaduwb

The ID of the instance.

RegionId String Yes cn-shanghai

The ID of the region where the instance resides.

Response parameters

Parameter Type Example Description
IsSuccess Boolean true

Indicates whether the operation is successful.

Code String success

The code returned for the request.

RequestId String E069EB86-E6AD-4A98-ADDE-0E993390239A

The ID of the request.

TempUsername String temp_user_cr

The username for temporary logon.

AuthorizationToken String shaunadadakks:uuczxnjcyeyhdjadkkajsjdjadhyucb

The password for temporary logon.

ExpireTime Long 1571242083000

The timestamp when the password expires.

Examples

Sample requests

http(s)://[Endpoint]/? Action=GetAuthorizationToken
&InstanceId=cri-kmsiwlxxdcvaduwb
&RegionId=cn-shanghai
&<Common request parameters>

Sample success responses

JSON format

{
    "AuthorizationToken": "shaunadadakks:uuczxnjcyeyhdjadkkajsjdjadhyucb",
    "Code": "success",
    "ExpireTime": "1571242083000",
    "IsSuccess": "true",
    "RequestId": "E069EB86-E6AD-4A98-ADDE-0E993390239A",
    "TempUsername": "temp_user_cr"
}

XML format

<AuthorizationToken>shaunadadakks:uuczxnjcyeyhdjadkkajsjdjadhyucb</AuthorizationToken>
<Code>success</Code>
<ExpireTime/>
<IsSuccess>true</IsSuccess>
<RequestId>E069EB86-E6AD-4A98-ADDE-0E993390239A</RequestId>
<TempUsername>temp_user_cr</TempUsername>

Error codes

For a list of error codes, visit the API Error Center.