Updated on 2024-07-30 GMT+08:00

Importing a Metadata File

Function

This API is provided for the administrator to import a metadata file.

This API is used to import a metadata file to IAM to implement federated identity authentication. The metadata file specifies API addresses and certificate information in compliance with the SAML 2.0 standard. To obtain the metadata file of your enterprise IdP, contact the enterprise administrator.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

Debugging

You can debug this API in API Explorer.

URI

POST /v3-ext/OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}/metadata

Table 1 URI parameters

Parameter

Mandatory

Type

Description

idp_id

Yes

String

Identity provider name.

protocol_id

Yes

String

Protocol ID.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

Access token issued to a user to bear its identity and permissions.

For details about the permissions required by the token, see Actions.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Account ID.

xaccount_type

Yes

String

Account source. This parameter is left blank by default.

metadata

Yes

String

Metadata of the IdP server.

Response Parameters

Table 4 Parameters in the response body

Parameter

Type

Description

message

String

Import result.

Example Request

Request for importing a metadata file

POST https://iam.myhuaweicloud.com/v3-ext/OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}/metadata
{
    "xaccount_type": "",
    "domain_id": "d78cbac186b744899480f25bd...",
    "metadata": "<md:EntityDescript..."
}

Example Response

Status code: 201

The metadata file is imported successfully.

{
    "message": "Import metadata successful"
}

Status Codes

Status Code

Description

201

The metadata file is imported successfully.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

500

Internal server error.

Error Codes

None