forked from laiweijian4/doc-exports
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>
25 lines
2.8 KiB
HTML
25 lines
2.8 KiB
HTML
<a name="rds_03_0001"></a><a name="rds_03_0001"></a>
|
|
|
|
<h1 class="topictitle1">Authentication</h1>
|
|
<div id="body1526376873787"><p id="rds_03_0001__p27556670">Token authentication must be performed to call APIs.</p>
|
|
<p id="rds_03_0001__p4531593915538">Authentication using tokens: General requests are authenticated using tokens.</p>
|
|
<div class="section" id="rds_03_0001__section2417768214391"><h4 class="sectiontitle">Token-based Authentication</h4><div class="note" id="rds_03_0001__note133321911123"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="rds_03_0001__p1254514271026">The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API used to obtain a user token.</p>
|
|
</div></div>
|
|
<p id="rds_03_0001__p18703477214">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="rds_03_0001__p116169153412">In <a href="rds_03_0005.html">Making an API Request</a>, the process of calling the API used to <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">obtain a user token</a> is described.</p>
|
|
<p id="rds_03_0001__p9691122114266">After a token is obtained, add the <strong id="rds_03_0001__b1897020427341">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 <span class="parmvalue" id="rds_03_0001__parmvalue1038232518315"><b>ABCDEFJ....</b></span>, <span class="parmvalue" id="rds_03_0001__parmvalue10383725113110"><b>X-Auth-Token: ABCDEFJ....</b></span> can be added to a request as follows:</p>
|
|
<div class="codecoloring" codetype="Java" id="rds_03_0001__screen11189101154015"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">Content</span><span class="o">-</span><span class="n">Type</span><span class="p">:</span><span class="w"> </span><span class="n">application</span><span class="o">/</span><span class="n">json</span><span class="w"></span>
|
|
<span class="n">X</span><span class="o">-</span><span class="n">Auth</span><span class="o">-</span><span class="n">Token</span><span class="p">:</span><span class="w"> </span><span class="n">ABCDEFJ</span><span class="p">....</span><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rds_02_0001.html">Calling APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|