Returns the temporary account and password that are used to log on to the Container Registry console. The temporary password is valid for one hour. If you send a Security Token Service (STS) request, the temporary password is valid within the validity period of the STS token.

Permission descriptions

Call method Permission description
Alibaba Cloud account Logon to the Container Registry console with the temporary token and logon to the console with an Alibaba Cloud account allow you to have the same permissions.
RAM user Logon to the Container Registry console with the temporary token and logon to the console as a Resource Access Management (RAM) user allow you to have the same permissions.
STS If you log on to the Container Registry console with the temporary token, the permissions that are granted to your account are determined by the authorization policies of the RAM role.

Request information

Request line

Get /tokens HTTP/1.1

Request line parameters

None.

Operation-specific request headers

None.

Request body

None.

Response information

Response line

HTTP/1.1 200 OK

Operation-specific response headers

None.

Response body

{
    "data": {
        "authorizationToken": "String",
        "tempUserName": "String",
        "expireDate": Long
    },
    "requestId": "String"
}

Response body parameters

Parameter Type Description
authorizationToken String The password that was used to log on to the Container Registry console.
tempUserName String The username that was used to log on to the Container Registry console.
expireDate Long The timestamp when the temporary token expired. Unit: milliseconds.

Examples

Sample requests

Get /tokens HTTP/1.1
<Common request headers>

Sample responses

HTTP/1.1 200 OK
<Common response headers>

{
    "data": {
        "authorizationToken": "eyJ0aW1lIjoiMTUyNjU0OTc5:0705733****",
        "tempUserName": "cr_temp_user",
        "expireDate": 1526549792000
    },
    "requestId": "94E89857-B994-44B6-9C4F-DBD200E9E272"
}