Changeset View
Changeset View
Standalone View
Standalone View
swh/web/api/templates/api.html
Show First 20 Lines • Show All 288 Lines • ▼ Show 20 Lines | <p> | ||||
<a href="{% url 'oidc-login' %}">Software Heritage Authentication service</a> must be created. | <a href="{% url 'oidc-login' %}">Software Heritage Authentication service</a> must be created. | ||||
<br/> | <br/> | ||||
To generate and manage bearer tokens, a dedicated interface is available on the | To generate and manage bearer tokens, a dedicated interface is available on the | ||||
<a href="{% url 'oidc-profile' %}#tokens">user profile page</a> once logged in. | <a href="{% url 'oidc-profile' %}#tokens">user profile page</a> once logged in. | ||||
</p> | </p> | ||||
<p> | <p> | ||||
The following shows how to perform an authenticated request to the Web API using <code>curl</code>. | The following shows how to perform an authenticated request to the Web API using <code>curl</code>. | ||||
<pre>export TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJhMTMxYTQ1My1hM2IyLTQwMTUtO... | <pre>export TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJhMTMxYTQ1My1hM2IyLTQwMTUtO... | ||||
curl -H "Authorization: Bearer ${TOKEN}" {{ site_base_url }}api/...</pre> | curl -H "Authorization: Bearer ${TOKEN}" {{ site_base_url }}/api/...</pre> | ||||
</p> | </p> | ||||
<p> | <p> | ||||
Authenticated requests can be used to lift rate limiting if the user account has the adequate | Authenticated requests can be used to lift rate limiting if the user account has the adequate | ||||
permission. | permission. | ||||
If you are in such a need, please <a href="https://www.softwareheritage.org/contact/">contact us</a> | If you are in such a need, please <a href="https://www.softwareheritage.org/contact/">contact us</a> | ||||
and we will review your request. | and we will review your request. | ||||
</p> | </p> | ||||
{% endif %} | {% endif %} | ||||
</div> | </div> | ||||
<script> | <script> | ||||
swh.webapp.initPage('api'); | swh.webapp.initPage('api'); | ||||
</script> | </script> | ||||
{% endblock %} | {% endblock %} |