Merge branch 'master' of ssh://gitlab.larvit.se:10022/power-plan/auth

This commit is contained in:
Filip Johansson 2021-01-04 16:28:05 +01:00
commit 86b4ab5f93

View File

@ -21,3 +21,8 @@ On first startup with a clean database, an account with name "admin" and the fie
## Special account field: "role" ## Special account field: "role"
The account field "role" is a bit special, in that if it contains "admin" as one of its values, that grants access to all methods on all accounts on this service. It might be a good idea to use the field "role" for authorization throughout your services. The account field "role" is a bit special, in that if it contains "admin" as one of its values, that grants access to all methods on all accounts on this service. It might be a good idea to use the field "role" for authorization throughout your services.
## Some useful cURLs
Obtain an admin GWT: `curl -d '"api-key-goes-here"' -H "Content-Type: application/json" -i http://localhost:4000/auth/api-key`
Use a bearer token to make a call: `curl -H "Content-Type: application/json" -H "Authorization: bearer your-JWT-token-goes-here" -i http://localhost:4000/account/{accountID}`