Vault Error Error making API request Code: 403 Permission Denied

Hello Team,

I created new token for our terraform user (TF_VAR_VAULT_ADMIN_TOKEN) however, i am getting error

Error looking up token: Error making API request.

URL: GET https://abc.xyc.com:8200/v1/auth/token/lookup-self
Code: 403. Errors:

  • permission denied

Below is the error that i get when i run the command vault token lookup

Error looking up token: Error making API request.

URL: GET https://abc.xyx.com:8200/v1/auth/token/lookup-self
Code: 403. Errors:

  • permission denied

When i made created the token i was able to lookup the token however i have started getting this error now.

Below are the steps i used to create the token

vault token create -policy=“default”
vault token create -policy=“terraform_read_write”

Is there anything i am missing here? Please advise

Hi @balhimanshu10 ,

Are you passing the namespace parameter in as part of your API request? All HCP Vault clusters operate from the admin namespace, instead of root for self-hosted Vault.

This may provide some context HCP Vault namespace considerations | Vault | HashiCorp Developer