Obtains a pair of temporary username and password that is used to log on to a Container Registry instance.

The temporary password returned after you call this API operation is a Security Token Service (STS) token whose validity period is 1 hour. Take note of the following items when you log on to Container Registry instances by using an STS token:

  • If the STS token belongs to an Alibaba Cloud account, you can use the STS token to log on to all Container Registry instances that belong to the Alibaba Cloud account.
  • If the STS token belongs to a Resource Access Management (RAM) user, you can use the STS token to log on to all Container Registry instances that belong to the RAM user.
  • You can use an STS token to access only Container Registry instances to which the STS token is scoped.

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-kmsiwlxxdcv****

The ID of the Container Registry instance.

RegionId String Yes cn-shanghai

The ID of the region.

Response parameters

Parameter Type Example Description
AuthorizationToken String shaunadadakks:uuczxnjcyeyhdjadkkajsjd****

The password that is used to log on to the Container Registry instance.

Code String success

The return value.

ExpireTime Long 1571242083000

The timestamp when the temporary password expires. Unit: milliseconds.

IsSuccess Boolean true

Indicates whether the API call is successful.

  • true: successful
  • false: failed
RequestId String E069EB86-E6AD-4A98-ADDE-0E993390239A

The ID of the request.

TempUsername String temp_user_cr

The username that is used to log on to the Container Registry instance.

Examples

Sample requests

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

Sample success responses

XML format

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

JSON format

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

Error codes

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