Hello HashiCorp Community,
I was recently trying to automate my build and deploy process.
I was following this API Doc
I have created the required service principal, but I couldn’t find any documentation about how to authenticate Packer API’s via service principal through REST.
Hi @kuldeeprishi, Thanks for your feedback! I already passed this feedback internally and we will see options to add those information.
In the meantime, you can manually obtain your OAuth 2.0 access token using your HCP credentials (client ID/secret) using curl or any tools that work for you (e.g., Postman).
For instance, try this curl command by replacing $HCP_CLIENT_ID and $HCP_CLIENT_SECRET with yours (i.e., service principal key), then you will get one as below:
Once you got your access_token, now you can call APIs using that access token by sending an authorization request header -H 'Authorization: Bearer <your_access_token>'