pycloud/test.py

13 lines
572 B
Python

#!/bin/bash
username=XXX@cloe # login_ac_dijon@cloe
password= # mot de passe défini via l'iface web de CLOE VRA8
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
curl -H "Authorization: Bearer ${token}" 127.0.0.1:8080/catalog-types | jq