From 7e90c8b66dd214d560355c6ed1fd6102770b3c7e Mon Sep 17 00:00:00 2001 From: Lilleman Date: Mon, 4 Jan 2021 16:23:45 +0100 Subject: [PATCH] Added some curl examples --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index ad9708c..6016586 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,8 @@ On first startup with a clean database, an account with name "admin" and the fie ## 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. + +## 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}` \ No newline at end of file