Mercurial > prosody-modules
diff mod_rest/README.markdown @ 5179:5be04d1b16fb
mod_rest: Remove confusing oauth2 tokens from examples
Users were somehow confused into thinking that you should use the JID as
username, rather than the username.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 28 Feb 2023 18:15:20 +0100 |
parents | 51f7d72a56c2 |
children | d194d1012fd3 |
line wrap: on
line diff
--- a/mod_rest/README.markdown Thu Feb 23 21:07:13 2023 +0100 +++ b/mod_rest/README.markdown Tue Feb 28 18:15:20 2023 +0100 @@ -38,9 +38,9 @@ ## OAuth2 -[mod_http_oauth2] can be used to grant bearer tokens which are -accepted by mod_rest. Tokens can be passed to `curl` like -`--oauth2-bearer dmVyeSBzZWNyZXQgdG9rZW4K` as in some examples below. +[mod_http_oauth2] can be used to grant bearer tokens which are accepted +by mod_rest. Tokens can be passed to `curl` like `--oauth2-bearer +dmVyeSBzZWNyZXQgdG9rZW4K` instead of using `--user`. ## Sending stanzas @@ -62,7 +62,7 @@ ``` {.sh} curl https://prosody.example:5281/rest \ - --oauth2-bearer dmVyeSBzZWNyZXQgdG9rZW4K \ + --user username \ -H 'Content-Type: application/json' \ --data-binary '{ "body" : "Hello!", @@ -81,7 +81,7 @@ ``` curl https://prosody.example:5281/rest/message/chat/john@example.com \ - --oauth2-bearer dmVyeSBzZWNyZXQgdG9rZW4K \ + --user username \ -H 'Content-Type: text/plain' \ --data-binary 'Hello John!' ``` @@ -93,7 +93,7 @@ ``` {.sh} curl https://prosody.example:5281/rest \ - --oauth2-bearer dmVyeSBzZWNyZXQgdG9rZW4K \ + --user username \ -H 'Content-Type: application/xmpp+xml' \ --data-binary '<iq type="get" to="example.net"> <ping xmlns="urn:xmpp:ping"/> @@ -111,7 +111,7 @@ ``` curl https://prosody.example:5281/rest/version/example.com \ - --oauth2-bearer dmVyeSBzZWNyZXQgdG9rZW4K \ + --user username \ -H 'Accept: application/json' ```