HashiCorp Cloud Platform
hcp auth print-access-token
Command: hcp auth print-access-token
The hcp auth print-access-token
command prints an access token for the
currently authenticated account.
The output of this command can be used to set the Authorization: Bearer
<access_token>
HTTP header when manually making API requests.
Usage
$ hcp auth print-access-token [Optional Flags]
Examples
To print the access token:
$ hcp auth print-access-token
To use the access token when curling an API:
$ curl https://api.cloud.hashicorp.com/iam/2019-12-10/caller-identity \
--header "Authorization: Bearer $(hcp auth print-access-token)"