Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Admin api doc edit. Adding cURL command for bearer token without a client. #16334

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/16330.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding directions to the Admin section on getting a bearer token for an admin user with cURL.
1 change: 1 addition & 0 deletions changelog.d/16334.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding directions to the Admin section on getting a bearer token for an admin user with cURL.
6 changes: 6 additions & 0 deletions docs/usage/administration/admin_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ already on your `$PATH` depending on how Synapse was installed.

Finding your user's `access_token` is client-dependent, but will usually be shown in the client's settings.

To get an access token from cURL without a client, make a request to `_matrix/client/r0/login` with `type` set to `m.login.password`, `user`, and `password` set to their respective admin account values included in the data field:

```sh
curl -XPOST -d '{"type":"m.login.password", "user":"<admin>", "password":"<password>"}' "http://127.0.0.1:8008/_matrix/client/r0/login"
```
Comment on lines +21 to +25
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes you have password logins enabled. That might be OK, but we should probably clarify that ab it or something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I will update and resubmit!


## Making an Admin API request
For security reasons, we [recommend](../../../reverse_proxy.md#synapse-administration-endpoints)
that the Admin API (`/_synapse/admin/...`) should be hidden from public view using a
Expand Down