An HTTP bearer token is required by the REST client to use the vRealize Automation REST API. You can obtain a bearer token by authenticating to the identity service.

Input

Use the supported input parameters to control the command output.

A consumer request must specify the correct component registry service and resource. For example, the URL to obtain an HTTP bearer token must contain the identity service and token resource values.

Input

Description

host

host name.domain name of the vRealize Automation server, for example, mycompany.mktg.mydomain.com.

usrname

Specifies the tenant administrator user name.

passwd

Specifies the tenant administrator password.

tenantURLtoken

Specifies the tenant URL token determined by the system administrator when creating the tenant, for example, support.

Output

The following information is displayed as a result of your HTTP bearer token request.

Output

Description

expires

Contains the ISO 8601 timestamp indicating when the token expires.

id

Contains the HTTP bearer token to use in Authorization header in subsequent requests.

tenant

Displays the tenant ID associated with the token.

Response Status Codes

One of the following codes are displayed as a result of your HTTP bearer token request.

Status Code

Description

200 OK

Your request succeeded and the resource was updated. The response body contains the full representation of the resource.

400 BAD REQUEST

The data you provided in the POST failed validation. Inspect the response body for details.

401 UNAUTHORIZED

The request could not authenticate the user or authentication credentials required.

Example: curl Command

You can enter the following command line format to request an HTTP bearer token.

curl --insecure -H "Accept: application/json" -H 'Content-Type: application/json' --data '{"username":"usrname",
"password":"passwd","tenant":"tenantURLtoken"}' https://$host/identity/api/tokens

When your request succeeds, the system returns the 200 OK status code, the expiration date and time of the token, and the HTTP bearer token. After receiving the bearer token, you can include it in your request headers.