Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ FunctionGraph/ FAQs/ General FAQs/ How Do I Obtain a Token?

How Do I Obtain a Token?

Updated on 2023-06-19 GMT+08:00

You can use a token for authentication when calling APIs. To obtain a token, use the standard API of Identity and Access Management (IAM).

  • Run the following command to obtain the token in the CN South-Guangzhou region:
    curl -k -i  -X POST   https://iam.cn-south-1.myhuaweicloud.com/v3/auth/tokens  -H 'Content-Type: application/json'  -d '{
      "auth": {
        "identity": {
          "methods": [
            "password"
          ],
          "password": {
            "user": {
              "name": "HUAWEI CLOUD account",
              "password": "Login password",
              "domain": {
                 "name": "HUAWEI CLOUD account"
              }
            }
          }
        },
        "scope": {
          "project": {
            "name": "cn-south-1"
          }
        }
      }
    }'
  • Run the following command to obtain the token in the CN North-Beijing1 region:
    curl -k -i  -X POST   https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens  -H 'Content-Type: application/json'  -d '{
      "auth": {
        "identity": {
          "methods": [
            "password"
          ],
          "password": {
            "user": {
              "name": "HUAWEI CLOUD account",
              "password": "Login password",
              "domain": {
                "name": "HUAWEI CLOUD account"
              }
            }
          }
        },
        "scope": {
          "project": {
            "name": "cn-north-1"
          }
        }
      }
    }'
    NOTE:

    The value of X-Subject-Token in the response header is the token. A token obtained in one region can only be used to call FunctionGraph in this region.

    For details, see Obtaining a User Token.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback