mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-01-03 14:38:37 +01:00
Dedicate a section on how to use access tokens
Fixes https://github.com/matrix-org/matrix-doc/issues/1042.
This commit is contained in:
parent
669d526ea7
commit
25d01aa431
|
|
@ -191,10 +191,6 @@ previously obtained credentials in the form of an ``access_token`` query
|
|||
parameter or through an Authorization Header of ``Bearer $access_token``.
|
||||
An access token is typically obtained via the `Login`_ or `Registration`_ processes.
|
||||
|
||||
When credentials are required but missing or invalid, the HTTP call will
|
||||
return with a status of 401 and the error code, ``M_MISSING_TOKEN`` or
|
||||
``M_UNKNOWN_TOKEN`` respectively.
|
||||
|
||||
.. NOTE::
|
||||
|
||||
This specification does not mandate a particular format for the access
|
||||
|
|
@ -202,6 +198,19 @@ return with a status of 401 and the error code, ``M_MISSING_TOKEN`` or
|
|||
to choose an appropriate format. Server implementors may like to investigate
|
||||
`macaroons <macaroon_>`_.
|
||||
|
||||
Using access tokens
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Access tokens may be provided in two ways, both of which the homeserver MUST
|
||||
support:
|
||||
|
||||
1. Via a query string parameter, ``access_token=TheTokenHere``.
|
||||
#. Via a request header, ``Authorization: Bearer TheTokenHere``.
|
||||
|
||||
When credentials are required but missing or invalid, the HTTP call will
|
||||
return with a status of 401 and the error code, ``M_MISSING_TOKEN`` or
|
||||
``M_UNKNOWN_TOKEN`` respectively.
|
||||
|
||||
Relationship between access tokens and devices
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue