feat(oauth2): get access token route and read basic user info
This commit is contained in:
parent
ecf1da2978
commit
f990708052
32 changed files with 465 additions and 67 deletions
|
|
@ -1,5 +0,0 @@
|
|||
# Netscape HTTP Cookie File
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This file was generated by libcurl! Edit at your own risk.
|
||||
|
||||
localhost FALSE / FALSE 1731769020 minauth_jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiZDQzM2Y1MS1kOWViLTRlNjAtODM1OC03NTMyYzJjMGY0NmIiLCJleHAiOjE3MzEyNTA2MjB9.KOPkOd-c-UlBZ4JwWT8XeZKCbgNzSM0Hu2udTzb-rIY
|
||||
1
http_integration_tests/.gitignore
vendored
Normal file
1
http_integration_tests/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
tmp
|
||||
7
http_integration_tests/access_token_request.sh
Executable file
7
http_integration_tests/access_token_request.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
curl -v http://localhost:8085/api/token \
|
||||
-u "a1785786-8be1-443c-9a6f-35feed703609":"49c6c16a-0a8a-4981-a60d-5cb96582cc1a" \
|
||||
-d grant_type="authorization_code" \
|
||||
-d code="$(cat tmp/authorize_code.txt)" \
|
||||
-d redirect_uri="http://localhost:9090/authorize" > tmp/access_token.json
|
||||
|
|
@ -2,9 +2,14 @@
|
|||
|
||||
curl -v http://localhost:8085/authorize \
|
||||
-G \
|
||||
--cookie ".curl-cookies" \
|
||||
-D "tmp/headers.txt" \
|
||||
--cookie "tmp/.curl-cookies" \
|
||||
-d client_id="a1785786-8be1-443c-9a6f-35feed703609" \
|
||||
-d response_type="code" \
|
||||
-d redirect_uri="http://localhost:9090/authorize" \
|
||||
-d scope="read_basics" \
|
||||
-d state="qxYAfk4kf6pbZkms78jM"
|
||||
|
||||
code="$(cat tmp/headers.txt | grep -i "location" | awk -F ": " '{print $2}' | trurl -f - -g "{query:code}")"
|
||||
|
||||
echo "$code" > tmp/authorize_code.txt
|
||||
|
|
|
|||
5
http_integration_tests/get_user_info.sh
Executable file
5
http_integration_tests/get_user_info.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
curl -v http://localhost:8085/api/user \
|
||||
-u "a1785786-8be1-443c-9a6f-35feed703609":"49c6c16a-0a8a-4981-a60d-5cb96582cc1a" \
|
||||
-H "Authorization: JWT $(jq -r .access_token tmp/access_token.json)"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/sh
|
||||
|
||||
curl -v http://localhost:8085/login \
|
||||
--cookie-jar ".curl-cookies" \
|
||||
--cookie-jar "tmp/.curl-cookies" \
|
||||
-d login="test" \
|
||||
-d password="test"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue