--- a/mod_rest/README.markdown Mon Jul 20 21:54:52 2020 +0200
+++ b/mod_rest/README.markdown Mon Jul 20 21:55:07 2020 +0200
@@ -23,9 +23,15 @@
``` {.lua}
Component "rest.example.net" "rest"
-rest_credentials = "Bearer dmVyeSBzZWNyZXQgdG9rZW4K"
+component_secret = "dmVyeSBzZWNyZXQgdG9rZW4K"
+modules_enabled = {"http_oauth2"}
```
+## OAuth2
+
+[mod_http_oauth2] can be used to grant bearer tokens which are
+accepted by mod_rest.
+
## Sending stanzas
The API endpoint becomes available at the path `/rest`, so the full URL
@@ -35,7 +41,7 @@
``` {.sh}
curl https://prosody.example:5281/rest \
- --oauth2-bearer dmVyeSBzZWNyZXQgdG9rZW4K \
+ --user username \
-H 'Content-Type: application/xmpp+xml' \
--data-binary '<message type="chat" to="user@example.org">
<body>Hello!</body>