docs: update authorization documentation

Document the "force_logins" option and the ability to accept JSON Web Tokens via the query string.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-05-19 19:59:06 -04:00
parent b8cf0d7fd2
commit 36aec50bce
2 changed files with 13 additions and 3 deletions

View File

@ -98,6 +98,11 @@ cors_domains:
# When CORS is enabled by adding an entry to this option, all origins # When CORS is enabled by adding an entry to this option, all origins
# matching the "trusted_clients" option will have CORS headers set as # matching the "trusted_clients" option will have CORS headers set as
# well. If this option is not specified then CORS is disabled. # well. If this option is not specified then CORS is disabled.
force_logins: False
# When set to True a user login is required for authorization if at least
# one user has been created, overriding the "trusted_clients" configuration.
# If no users have been created then trusted client checks will apply.
# The default is False.
``` ```
## `[octoprint_compat]` ## `[octoprint_compat]`

View File

@ -1541,10 +1541,15 @@ Moonraker's HTTP APIs. JWTs should be included in the `Authorization`
header as a `Bearer` type for each HTTP request. If using an API Key it header as a `Bearer` type for each HTTP request. If using an API Key it
should be included in the `X-Api-Key` header for each HTTP Request. should be included in the `X-Api-Key` header for each HTTP Request.
!!! note
For requests in which clients cannot modify headers it is acceptable
to pass the JWT via the query string's `access_token` argument.
Alternatively client developers may request a `oneshot_token` and
send the result via the `token` query string argument.
!!! warning !!! warning
Clients should not use the query string to pass arguments to these It is strongly recommended that arguments for the below APIs are
APIs. Arguments may be passed as part of the body either in JSON passed in the request's body.
format or as form-data.
#### Login User #### Login User
HTTP Request: HTTP Request: