actix-surreal/tools/get_token.sh
2024-07-24 13:22:50 +02:00

10 lines
464 B
Bash
Executable file

curl -sf -L -X POST 'http://localhost:8080/realms/master/protocol/openid-connect/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "client_id=actix" \
--data-urlencode "grant_type=password" \
--data-urlencode "client_secret=JQI6gnEeHlaOX3yzZsiVwAAUIouTlR4j" \
--data-urlencode "scope=openid" \
--data-urlencode "username=${1-admin}" \
--data-urlencode "password=${2-admin}" > token.json
jq -r .access_token < token.json > token.txt