Skip to content

Commit 09b821a

Browse files
committed
docs: Document token auth support
Signed-off-by: Stephen Finucane <[email protected]> Acked-by: Andrew Donnellan <[email protected]>
1 parent 85c8f36 commit 09b821a

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

docs/api/rest.rst

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,29 @@ parameters should be passed as form-encoded data:
161161
Authentication
162162
--------------
163163

164-
Patchwork only supports basic authentication:
164+
Patchwork supports authentication using your username and password (basic
165+
authentication) or with a token (token authentication). The latter is
166+
recommended.
167+
168+
To authenticate with token authentication, you must first obtain a token. This
169+
can be done from your profile, e.g. https://patchwork.example.com/profile.
170+
Once you have a token, run:
171+
172+
.. code-block:: shell
173+
174+
$ curl -H "Authorization: Token ${token}" \
175+
'https://patchwork.example.com/api/'
176+
177+
To authenticate using basic auth, you should use your Patchwork username and
178+
password. To do this, run:
165179

166180
.. code-block:: shell
167181
168-
$ curl -u username:password 'https://patchwork.example.com/api/'
182+
$ curl -u ${username}:${password} \
183+
'https://patchwork.example.com/api/'
169184
170-
Not all resources require authentication. Those that do will return ``404 Not
171-
Found`` if authentication is not provided to avoid leaking information.
185+
Not all resources require authentication. Those that do will return ``404 (Not
186+
Found)`` if authentication is not provided to avoid leaking information.
172187

173188
Pagination
174189
----------

0 commit comments

Comments
 (0)