pycloud/get_token.sh

10 lines
415 B
Bash
Raw Normal View History

#!/bin/bash
2024-01-12 14:44:18 +01:00
source ./credentials
refresh_token=$(curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"${username}\", \"password\":\"${password}\"}" 127.0.0.1:8080/login | jq -r .refresh_token)
echo refresh_token: $refresh_token
token=$(curl -X POST -H "Content-Type: application/json" -d "{\"refresh_token\":\"${refresh_token}\"}" 127.0.0.1:8080/perform-login | jq -r .token)
echo token: $token