POST https://VMWareAriaAutomationFQDN/csp/gateway/am/api/login?access_token
hostname='VMwareAriaAutomationFQDN' username='your_username' password='your_password' api_token=$(curl -k -X POST "https://$hostname/csp/gateway/am/api/login?access_token" -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{ "username": "'$username'", "password": "'$password'" }' | jq -r .refresh_token)
echo "api_token: $api_token"
In case when you have multiple vIDM directories, you might need to provide domain in the payload, like
hostname='VMwareAriaAutomationFQDN'
username='your_username'
password='your_password'
domain='domain'
api_token=$(curl -k -X POST "https://$hostname/csp/gateway/am/api/login?access_token" -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{ "username": "'$username'", "password": "'$password'", "domain", "'$domain'" }' | jq -r .refresh_token)
echo "api_token: $api_token
POST https://VMwareAriaAutomationFQDN/iaas/api/login
bearer_token=$(curl -k -X POST https://$hostname/iaas/api/login -H "Accept: application/json" -H 'Content-Type: application/json' --data '{"refreshToken":"'"$api_token"'"}' | jq -r .token )
echo "bearer_token: $bearer_token"
Headers: 'Content-Type: application/json'
path":"/session-service/api/sessions/groups","status":404,"error":"Not Found","message":"404 NOT_FOUND \"Token not found\""