2024-11-08 22:38:54 +00:00
|
|
|
#!/usr/bin/sh
|
|
|
|
|
|
|
|
curl -v http://localhost:8085/authorize \
|
|
|
|
-G \
|
2024-11-11 13:49:17 +00:00
|
|
|
-D "tmp/headers.txt" \
|
|
|
|
--cookie "tmp/.curl-cookies" \
|
2024-11-08 22:38:54 +00:00
|
|
|
-d client_id="a1785786-8be1-443c-9a6f-35feed703609" \
|
|
|
|
-d response_type="code" \
|
2024-11-09 18:57:15 +00:00
|
|
|
-d redirect_uri="http://localhost:9090/authorize" \
|
2024-11-08 22:38:54 +00:00
|
|
|
-d scope="read_basics" \
|
|
|
|
-d state="qxYAfk4kf6pbZkms78jM"
|
2024-11-11 13:49:17 +00:00
|
|
|
|
|
|
|
code="$(cat tmp/headers.txt | grep -i "location" | awk -F ": " '{print $2}' | trurl -f - -g "{query:code}")"
|
|
|
|
|
|
|
|
echo "$code" > tmp/authorize_code.txt
|