doc-exports/docs/iam/api-ref/en-us_topic_0057845615.html
zhangyue 3b5a58b1fe IAM API 2.0.38
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2022-10-26 04:31:24 +00:00

166 lines
14 KiB
HTML

<a name="en-us_topic_0057845615"></a><a name="en-us_topic_0057845615"></a>
<h1 class="topictitle1">Importing a Metadata File</h1>
<div id="body1492680701566"><div class="section" id="en-us_topic_0057845615__section60756004163916"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0057845615__p1964183917222">Before using the federated identity authentication function, a metadata file must be imported to the IAM system. This API is used to import a metadata file of a domain.</p>
</div>
<div class="section" id="en-us_topic_0057845615__section66385700163916"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0057845615__ul8532652163916"><li id="en-us_topic_0057845615__li9685006163916">URI format<p id="en-us_topic_0057845615__p20056196163916"><a name="en-us_topic_0057845615__li9685006163916"></a><a name="li9685006163916"></a>POST /v3-ext/OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}/metadata</p>
</li></ul>
<ul id="en-us_topic_0057845615__ul13939156163916"><li id="en-us_topic_0057845615__li58343545163916">URI parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845615__table55329861163916" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845615__row25801157163916"><th align="left" class="cellrowborder" valign="top" width="20.48795120487951%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="en-us_topic_0057845615__p9518943163916"><strong id="en-us_topic_0057845615__b37426530113629">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.008299170082992%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="en-us_topic_0057845615__p32836901163916"><strong id="en-us_topic_0057845615__b842352706112524">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.958204179582044%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="en-us_topic_0057845615__p42543361163916"><strong id="en-us_topic_0057845615__b84235270615026">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.54554544545545%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="en-us_topic_0057845615__p23460184163916"><strong id="en-us_topic_0057845615__b14438018113629">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845615__row21226772163916"><td class="cellrowborder" valign="top" width="20.48795120487951%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p41647005163916">idp_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.008299170082992%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p17964250163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.958204179582044%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p45818164163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.54554544545545%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p20283794163916">Identity provider ID.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row48336422163916"><td class="cellrowborder" valign="top" width="20.48795120487951%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p22936134163916">protocol _id</p>
</td>
<td class="cellrowborder" valign="top" width="17.008299170082992%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p45887583163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.958204179582044%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p25906712163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.54554544545545%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p18068889163916">Protocol ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845615__section54293899163916"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0057845615__ul35729685163916"><li id="en-us_topic_0057845615__li53131715163916">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845615__table8423392163916" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845615__row19381879163916"><th align="left" class="cellrowborder" valign="top" width="20.31%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0057845615__p26428347163916"><strong id="en-us_topic_0057845615__b91932197">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.24%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0057845615__p60321356163916"><strong id="en-us_topic_0057845615__b1111038147">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.91%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0057845615__p54191633163916"><strong id="en-us_topic_0057845615__b921258801">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.54%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0057845615__p27446130163916"><strong id="en-us_topic_0057845615__b1389947903">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845615__row8544089163916"><td class="cellrowborder" valign="top" width="20.31%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p20982571163916">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="17.24%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p21866706163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.91%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p26372790163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.54%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p55821246163916">Fill <strong id="en-us_topic_0057845615__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row32629171163916"><td class="cellrowborder" valign="top" width="20.31%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p25717229163916">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="17.24%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p2720832163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.91%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p19060819163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.54%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p19047553144032">Authenticated token with the <strong id="en-us_topic_0057845615__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0057845615__ul34220762163916"><li id="en-us_topic_0057845615__li39551406163916">Parameters in the request body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845615__table20418334163916" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845615__row21228487163916"><th align="left" class="cellrowborder" valign="top" width="20.549999999999997%" id="mcps1.3.3.3.1.1.1.5.1.1"><p id="en-us_topic_0057845615__p41785905163916"><strong id="en-us_topic_0057845615__b396966478">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.82%" id="mcps1.3.3.3.1.1.1.5.1.2"><p id="en-us_topic_0057845615__p29215135163916"><strong id="en-us_topic_0057845615__b1225991079">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.26%" id="mcps1.3.3.3.1.1.1.5.1.3"><p id="en-us_topic_0057845615__p17615738163916"><strong id="en-us_topic_0057845615__b1685821082">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.37%" id="mcps1.3.3.3.1.1.1.5.1.4"><p id="en-us_topic_0057845615__p17588649163916"><strong id="en-us_topic_0057845615__b1789141629">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845615__row15394453163916"><td class="cellrowborder" valign="top" width="20.549999999999997%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p38991141163916">xaccount_type</p>
</td>
<td class="cellrowborder" valign="top" width="16.82%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p4165825163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.26%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p1887570163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.37%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p18675520163916">Source of a domain. This field is left blank by default.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row33861957163916"><td class="cellrowborder" valign="top" width="20.549999999999997%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p58464009163916">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="16.82%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p37964252163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.26%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p55205609163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.37%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p42469334163916">Content of the metadata file on the IdP server.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row46679688163916"><td class="cellrowborder" valign="top" width="20.549999999999997%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845615__p22958377163916">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.82%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845615__p47689214163916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.26%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845615__p37621103163916">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.37%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845615__p27410534163916">ID of the domain that a user belongs to.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0057845615__ul5660744163916"><li id="en-us_topic_0057845615__li50946702163916">Example request<pre class="screen" id="en-us_topic_0057845615__screen55867135163916">curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X POST -d '{"xaccount_type":"","domain_id":"ed7a77d365304f458f7d0a7909c6d889","metadata":"$metadataContent"}' https://sample.domain.com/v3-ext/OS-FEDERATION/identity_providers/ACME/protocols/saml/metadata</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845615__section62771979163916"><h4 class="sectiontitle">Response Parameters</h4><p id="en-us_topic_0057845615__p703824117914">Example response</p>
<pre class="screen" id="en-us_topic_0057845615__screen32281272163916">{ "message": "Import metadata successful"}</pre>
</div>
<div class="section" id="en-us_topic_0057845615__section64646211163916"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845615__table1851743163916" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845615__row23259822163916"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0057845615__p4997463163916"><strong id="en-us_topic_0057845615__b842352706104328">Status Code</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.2"><p id="en-us_topic_0057845615__p2141364163916"><strong id="en-us_topic_0057845615__b1868930385">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845615__row39232814163916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845615__p23741356163916">201</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845615__p44001687163916">The import is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row60470864163916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845615__p66301833163916">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845615__p1739362163916">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row15654258163916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845615__p60035358163916">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845615__p31025855163916">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row10797247163916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845615__p2161834163916">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845615__p40890878163916">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0057845615__row32473582163916"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845615__p13114481163916">500</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845615__p55640049163916">Internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0057845607.html">Metadata</a></div>
</div>
</div>