Auth

In order to make API requests against the vRA endpoints, an Auth token needs to be requested and submitted in subsequent requests. The Auth token can be requested in the following way:

POST
Get authentication token
curl --location --request POST 'https://{{va-fqdn}}/identity/api/tokens' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{"username":"{{username}}","password":"{{password}}","tenant":"{{tenant}}"}'
{
  "expires": "{{expiryDate}}",
  "id": "{{token}}",
  "tenant": "{{tenant}}"
}

The received id can then be used as the Bearer token in further requests and shall be submitted as authorization header like so:

curl --location --request GET '{{apiEndpoint}}' \
--header 'Authorization: Bearer {{token}}'

The token expires after 6 hours, after which a new token needs to be requested.

Last Updated: