All Products
Search
Document Center

Get a temporary token

Last Updated: Jun 30, 2019

Description

Use the temporary account and password to log on to Container Registry. The temporary password is valid for one hour. In case of STS request, the temporary password valid time is equal to the STS token request validity time.

Permission description

Call method Permission description
Primary account Log on to Container Registry with the temporary token is the same as primary account logs on to Container Registry with the username and password.
Sub-account Log on to Container Registry with the temporary token is the same as sub-account logs on to Container Registry with the username and password.
STS The permission to log on to Container Registry with the temporary token is determined by the role policy.

Request information

Request line

  1. Get /tokens HTTP/1.1

Request line parameters (URI parameters)

None.

Special request header

None.

Request body

None.

Response information

Response line

  1. HTTP/1.1 200 OK

Special response header

None.

Response body

  1. {
  2. "data": {
  3. "authorizationToken": "String",
  4. "tempUserName": "String",
  5. "expireDate": Long
  6. },
  7. "requestId": "String"
  8. }

Response body explanation

Name Type Description
authorizationToken String Password used to log on to Container Registry.
tempUserName String Username used to log on to Container Registry.
expireDate Long The token expiration timestamp (in ms).

Example

Request example

  1. Get /tokens HTTP/1.1
  2. <Common request header>

Response example

  1. HTTP/1.1 200 OK
  2. <Common response header>
  3. {
  4. "data": {
  5. "authorizationToken": "eyJ0aW1lIjoiMTUyNjU0OTc5:07057333e85",
  6. "tempUserName": "cr_temp_user",
  7. "expireDate": 1526549792000
  8. },
  9. "requestId": "94E89857-B994-44B6-9C4F-DBD200E9E272"
  10. }