Updated on 2024-10-11 GMT+08:00

GetIAMToken

Overview

This system keyword is used for obtaining an IAM user token through username or password authentication. A token is an access credential issued to an IAM user. It carries their identity and permissions. When calling APIs of IAM and other cloud services, you can use this system keyword to obtain an IAM user token.

Parameter Description

Parameter

Mandatory

Type

Default Value

Description

IAM Token URL

Yes

String

https://iam.myhuaweicloud.com/v3/auth/tokens

IAM endpoint.

This API can be called using both global and regional endpoints.

Domain Name

Yes

String

<Empty>

IAM account or tenant name.

When a Huawei account is used for login, the tenant (account) name is the same as the username. For details about how to obtain an account name, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

User Name

Yes

String

<Empty>

IAM username. For details about how to obtain a username, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

Password

Yes

String

<Empty>

IAM user login password. (The login password is personal information and must be defined as sensitive in the environment parameters.)

Region ID

No

String

<Empty>

Region ID, for example, cn-north-1. For details about how to obtain a region ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

Default Checkpoint

Name

Expected Value

Result

Success

Default Response Extraction

Name

Extraction Variable

Description

IAM_TOKEN

X-Subject-Token

User token character

Response

  • Status: success

    Parameter

    Type

    Description

    Body

    Response body of the IAM API

    Response body of the IAM API

  • Example response
{
    "token": {
        "catalog": [],
        "expires_at": "2020-01-04T09:05:22.701000Z",
        "issued_at": "2020-01-03T09:05:22.701000Z",
        "methods": [
            "password"
        ],
        "project": {
            "domain": {
                "id": "d78cbac186b744899480f25bd022f...",
                "name": "IAMDomain"
            },
            "id": "aa2d97d7e62c4b7da3ffdfc11551f...",
            "name": "cn-north-1"
        },
        "roles": [
            {
                "id": "0",
                "name": "te_admin"
            },
            {
                "id": "0",
                "name": "op_gated_OBS_file_protocol"
            },
            {
                "id": "0",
                "name": "op_gated_Video_Campus"
            }
        ],
        "user": {
            "domain": {
                "id": "d78cbac186b744899480f25bd022f...",
                "name": "IAMDomain"
            },
            "id": "7116d09f88fa41908676fdd4b039e...",
            "name": "IAMUser",
            "password_expires_at": ""
        }
    },
    "X-Subject-Token": "MIIatAYJKoZIhvcNAQcCoIIapTCCGqECAQExDTALB..."
}

Example

  • Obtaining an IAM user token

The Password field needs to be configured as a sensitive parameter in the variable. Select a value from the drop-down list box.

  • Referencing a token in an API

IAM_TOKEN is the reserved default response extraction and can be directly referenced in the request.