summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorErnst Widerberg <ernst@sunet.se>2022-01-14 13:24:28 +0100
committerErnst Widerberg <ernst@sunet.se>2022-01-14 13:24:28 +0100
commite623a6a7a65639e280b6b3ed8513fb932c8a41eb (patch)
tree3eb4a53dd312bf8cebdef0a75f9913fda8d0bd44 /README.md
parentbb1d91b8e87c7019574b01bbf44dbff83d8bae52 (diff)
REDAME: Add tip about JWT decoding
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/README.md b/README.md
index 40fdb1f..144f9a3 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,13 @@ We can also limit the number of results and skip N results forward with the para
curl -s -H "Authorization: Bearer $JWT" 'http://localhost:80/sc/v0/get?limit=5&skip=2' | json_pp -json_opt utf8,pretty
-There is also a convenience script `do-as` which simplifies performing actions as a particular user.
+## Tips and tricks
+
+There is a convenience script `do-as` which simplifies performing actions as a particular user.
+
+You can decode a JWT using jq by piping to `jq -r '.access_token | split(".") | .[0],.[1] | @base64d' | jq`. Full example:
+
+ curl http://localhost:8000/api/v1.0/auth -X POST -p -u user1:pwd | jq -r '.access_token | split(".") | .[0],.[1] | @base64d' | jq
## Development