doc-exports/docs/iam/api-ref/en-us_topic_0057845575.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

217 lines
17 KiB
HTML

<a name="en-us_topic_0057845575"></a><a name="en-us_topic_0057845575"></a>
<h1 class="topictitle1">Registering a Protocol</h1>
<div id="body1492676120179"><div class="section" id="en-us_topic_0057845575__section6159829710289"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0057845575__p202967103215">This API is used to register a protocol, that is, associate a rule with an identity provider.</p>
</div>
<div class="section" id="en-us_topic_0057845575__section932889710289"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0057845575__ul1744316010289"><li id="en-us_topic_0057845575__li2277071810289">URI format<p id="en-us_topic_0057845575__p360987610289"><a name="en-us_topic_0057845575__li2277071810289"></a><a name="li2277071810289"></a>PUT /v3/OS-FEDERATION/identity_providers/{idp_id}/protocols/{protocol_id}</p>
</li></ul>
<ul id="en-us_topic_0057845575__ul2396457310289"><li id="en-us_topic_0057845575__li1435457010289">URI parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845575__table6208226610289" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845575__row2710995810289"><th align="left" class="cellrowborder" valign="top" width="21.020000000000003%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="en-us_topic_0057845575__p4842300710289"><strong id="en-us_topic_0057845575__en-us_topic_0026586105_b842352706143612">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.830000000000002%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="en-us_topic_0057845575__p2994946410289"><strong id="en-us_topic_0057845575__en-us_topic_0026586105_b842352706143621">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.1%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="en-us_topic_0057845575__p998748110289"><strong id="en-us_topic_0057845575__b842352706143526_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.050000000000004%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="en-us_topic_0057845575__p367962710289"><strong id="en-us_topic_0057845575__b20601766145329_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845575__row2961435710289"><td class="cellrowborder" valign="top" width="21.020000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p4995273610289">idp_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.830000000000002%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p1963982810289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p4732219910289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p789294810289">ID of an identity provider.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row392767110289"><td class="cellrowborder" valign="top" width="21.020000000000003%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p4970591510289">protocol _id</p>
</td>
<td class="cellrowborder" valign="top" width="17.830000000000002%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p6675617210289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p3854081710289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p3479845010289">ID of a protocol. </p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845575__section10223310289"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0057845575__ul828087510289"><li id="en-us_topic_0057845575__li741901710289">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845575__table6677115410289" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845575__row5794046110289"><th align="left" class="cellrowborder" valign="top" width="21.020000000000003%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0057845575__p6266579210289"><strong id="en-us_topic_0057845575__b1284193100">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.830000000000002%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0057845575__p4276437110289"><strong id="en-us_topic_0057845575__b1503207770">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.1%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0057845575__p4136199810289"><strong id="en-us_topic_0057845575__b842352706143526_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.050000000000004%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0057845575__p6198754610289"><strong id="en-us_topic_0057845575__b20601766145329_3">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845575__row5493532610289"><td class="cellrowborder" valign="top" width="21.020000000000003%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p2057645110289">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="17.830000000000002%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p5607985710289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p4617454310289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p4915046910289">Fill <strong id="en-us_topic_0057845575__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row3970104110289"><td class="cellrowborder" valign="top" width="21.020000000000003%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p6166774310289">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="17.830000000000002%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p2903129010289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p272426510289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p28734406143622">Authenticated token with the <strong id="en-us_topic_0057845575__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0057845575__li3983238110289">Parameters in the request body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845575__table2294710910289" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845575__row3973971710289"><th align="left" class="cellrowborder" valign="top" width="21.28212821282128%" id="mcps1.3.3.2.2.1.1.5.1.1"><p id="en-us_topic_0057845575__p6480052110289"><strong id="en-us_topic_0057845575__b1447609119">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.7017701770177%" id="mcps1.3.3.2.2.1.1.5.1.2"><p id="en-us_topic_0057845575__p1435081210289"><strong id="en-us_topic_0057845575__b544789376">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.961796179617963%" id="mcps1.3.3.2.2.1.1.5.1.3"><p id="en-us_topic_0057845575__p2156516110289"><strong id="en-us_topic_0057845575__b842352706143526_5">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.05430543054305%" id="mcps1.3.3.2.2.1.1.5.1.4"><p id="en-us_topic_0057845575__p194760610289"><strong id="en-us_topic_0057845575__b20601766145329_5">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845575__row2353837910289"><td class="cellrowborder" valign="top" width="21.28212821282128%" headers="mcps1.3.3.2.2.1.1.5.1.1 "><p id="en-us_topic_0057845575__p2756056110289">mapping_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.7017701770177%" headers="mcps1.3.3.2.2.1.1.5.1.2 "><p id="en-us_topic_0057845575__p1781297510289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.961796179617963%" headers="mcps1.3.3.2.2.1.1.5.1.3 "><p id="en-us_topic_0057845575__p3356491010289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.05430543054305%" headers="mcps1.3.3.2.2.1.1.5.1.4 "><p id="en-us_topic_0057845575__p3440322210289">Mapping ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0057845575__ul3519758210289"><li id="en-us_topic_0057845575__li4834278310289">Example request<pre class="screen" id="en-us_topic_0057845575__screen531968421443"><em id="en-us_topic_0057845575__i84412045111510">curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X PUT -d'{"protocol":{"mapping_id":"ACME"}}' https://sample.domain.com/v3/OS-FEDERATION/identity_providers/ACME/protocols/saml</em></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845575__section5620843410289"><h4 class="sectiontitle">Response Parameters</h4><ul id="en-us_topic_0057845575__ul5658933310289"><li id="en-us_topic_0057845575__li3954195110289">Parameters in the response body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845575__table2033324010289" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845575__row3108680210289"><th align="left" class="cellrowborder" valign="top" width="21.150000000000002%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="en-us_topic_0057845575__p3500305410289"><strong id="en-us_topic_0057845575__b1003905893">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.700000000000003%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="en-us_topic_0057845575__p1667515910289"><strong id="en-us_topic_0057845575__b90534482">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.1%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="en-us_topic_0057845575__p851064410289"><strong id="en-us_topic_0057845575__b842352706143526_7">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.050000000000004%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="en-us_topic_0057845575__p1827358210289"><strong id="en-us_topic_0057845575__b20601766145329_7">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845575__row376516410289"><td class="cellrowborder" valign="top" width="21.150000000000002%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p3654287110289">id</p>
</td>
<td class="cellrowborder" valign="top" width="17.700000000000003%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p718255010289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p4491566610289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p1429029010289">ID of a protocol. </p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row6150374710289"><td class="cellrowborder" valign="top" width="21.150000000000002%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p1574760510289">mapping_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.700000000000003%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p48761510289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p3949687410289">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p4513023810289">Mapping ID.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row351895810289"><td class="cellrowborder" valign="top" width="21.150000000000002%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845575__p1660017710289">links</p>
</td>
<td class="cellrowborder" valign="top" width="17.700000000000003%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845575__p243710510289">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.1%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845575__p6318779710289">Object</p>
</td>
<td class="cellrowborder" valign="top" width="43.050000000000004%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845575__p1793792610289">Protocol resource link.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0057845575__li774514013258">Example response<pre class="screen" id="en-us_topic_0057845575__screen5407914411214">{
"protocol": {
"id": "saml",
"links": {
"identity_provider": "https://example.com/v3/OS-FEDERATION/identity_providers/ACME",
"self": "https://example.com/v3/OS-FEDERATION/identity_providers/ACME/protocols/saml"
},
"mapping_id": "ACME"
}
}</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845575__section2630008410289"><h4 class="sectiontitle"><strong id="en-us_topic_0057845575__b842352706183230_1">Status Codes</strong></h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845575__table4993206110289" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845575__row1038470010289"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0057845575__p3585434210289"><strong id="en-us_topic_0057845575__b842352706183230_3">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_0057845575__p1852057210289"><strong id="en-us_topic_0057845575__b20601766145329_9">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845575__row2377140010289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p4643521510289">201</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p315609110289">The request is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row2840482710289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p1908962510289">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p275575910289">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row2480183510289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p6279160910289">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p5295557210289">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row683810110289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p1701532610289">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p3606413510289">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row5614175910289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p5118860310289">404</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p5263620410289">The requested resource cannot be found.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row396379610289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p5263207910289">405</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p3534001910289">The method specified in the request is not allowed for the requested resource.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row4962471510289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p6017897410289">413</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p4265873410289">The request entity is too large.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row4838428810289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p2681323710289">500</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p2438860310289">Internal server error.</p>
</td>
</tr>
<tr id="en-us_topic_0057845575__row1817084010289"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845575__p6255191310289">503</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845575__p3354022410289">Service unavailable.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0057845619.html">Protocol</a></div>
</div>
</div>