Software /
code /
prosody-modules
Diff
mod_rest/README.markdown @ 5932:dcea4b4c415d
Tweaking documentation to clarify that Oauth2 can be used for VirtualHosts and Component
installations.
author | Ben Smith <bens@effortlessis.com> |
---|---|
date | Tue, 14 May 2024 07:31:34 -0700 |
parent | 5931:d194d1012fd3 |
line wrap: on
line diff
--- a/mod_rest/README.markdown Mon May 13 13:25:13 2024 -0700 +++ b/mod_rest/README.markdown Tue May 14 07:31:34 2024 -0700 @@ -21,7 +21,8 @@ # Usage -You make a choice: install via VirtualHosts or as a Component. +You make a choice: install via VirtualHosts or as a Component. User authentication can +be used when installed via VirtualHost, and OAuth2 can be used for either. ## On VirtualHosts @@ -34,7 +35,18 @@ modules_enabled = {"rest"} ``` -### User authentication +## As a Component + +If you install this as a component, you won't be able to use user authentication above, +and must use OAuth2 authentication outlined below. + +``` {.lua} +Component "chat.example.com" "rest" +component_secret = "dmVyeSBzZWNyZXQgdG9rZW4K" +modules_enabled = {"http_oauth2"} +``` + +## User authentication To enable user authentication, edit the "admins = { }" section in prosody.cfg.lua, EG: @@ -58,18 +70,7 @@ -H 'Accept: application/json' ``` -## As a Component - -If you install this as a component, you won't be able to use user authentication above, -and must use OAuth2 authentication outlined below. - -``` {.lua} -Component "chat.example.com" "rest" -component_secret = "dmVyeSBzZWNyZXQgdG9rZW4K" -modules_enabled = {"http_oauth2"} -``` - -### OAuth2 +## 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