1
0
forked from docs/doc-exports
doc-exports/docs/dds/api-ref/dds_api_0010.html
Wang , Deng Ke 60010eb9d0 dds api 2.0.38sp24 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2023-01-13 08:55:41 +00:00

45 lines
3.0 KiB
HTML

<a name="dds_api_0010"></a><a name="dds_api_0010"></a>
<h1 class="topictitle1">Authentication</h1>
<div id="body1562038443100"><p id="dds_api_0010__p451113923113">DDS supports token authentication.</p>
<div class="section" id="dds_api_0010__section4838419162616"><h4 class="sectiontitle">Token Authentication</h4><div class="note" id="dds_api_0010__note16278457204513"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dds_api_0010__p1627913575453">The validity period of a token is 24 hours. If a token needs to be used, the system caches the token to avoid frequent calling.</p>
</div></div>
</div>
<p id="dds_api_0010__p135791862430">A token specifies temporary permissions in a computer system. During API authentication using a token, the token is added to requests to get permissions for calling the API.</p>
<p id="dds_api_0010__p194994815456">If you use a token for authentication, you must obtain the user's token and add <strong id="dds_api_0010__b978812211018">X-Auth-Token</strong> to the request message header of the service API when making an API call.</p>
<p id="dds_api_0010__p99321747541">When <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">calling an API to obtain a user token</a>, you must set <strong id="dds_api_0010__b1488222411119">auth.scope</strong> in the request body to <strong id="dds_api_0010__b198838241111">project</strong>.</p>
<pre class="codeblock" id="dds_api_0010__codeblock188472032105011">{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "<em id="dds_api_0010__i2084773213504">username</em>",
"password": "<em id="dds_api_0010__i1784813216505">password</em>",
"domain": {
"name": "<em id="dds_api_0010__i10848103214503">domainname</em>"
}
}
}
},
"scope": {
"project": {
"name": "xxxxxxxx"
}
}
}
}</pre>
<p id="dds_api_0010__p14474111714512">After a token is obtained, add the <strong id="dds_api_0010__b1783819304914">X-Auth-Token</strong> header field must be added to requests to specify the token when calling other APIs. For example, if the token is <strong id="dds_api_0010__b75452331098">ABCDEFJ....</strong>, add <strong id="dds_api_0010__b105451331916">X-Auth-Token: ABCDEFJ....</strong> in a request as follows:</p>
<pre class="screen" id="dds_api_0010__screen178605610011">POST https://dds.eu-de.otc.t-systems.com/v3/auth/projects
Content-Type: application/json
<strong id="dds_api_0010__b1887196203">X-Auth-Token: ABCDEFJ....</strong></pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_api_0007.html">Environment Preparations</a></div>
</div>
</div>