#!/bin/bash # API base URL API_BASE_URL="http://localhost:8080/api/v1/" # Login credentials USERNAME="boxuser" PASSWORD="boxuser" # Get a new JWT token TOKEN=$(curl -s -X POST -H "Content-Type: application/json" \ -d "{\"username\":\"$USERNAME\", \"password\":\"$PASSWORD\"}" \ "$API_BASE_URL/login" | jq -r '.token') echo $TOKEN curl -X GET \ $API_BASE_URL/admin/user \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json"