Otp key per api - permission denied

Hi, maybe someone can help.
I try to request an otp via the api
In the UI it works fine
login with ldap user works

curl --request POST \            
  --data @payload.json \

but when I try to get an otp I get permission denied.

 curl \
  --request POST \
  --data @ip.json \
{"errors":["permission denied"]}

Thank you!

Nowhere in this command are you sending your Vault token along with the request, so you are effectively not logged in at this point.

If you really want to use curl instead of the Vault CLI, you have to manually include an X-Vault-Token header with every non-login request.

Thanks maxb,

do I get the X-Vault-Token with the login request or how do I get it? :slight_smile:
Or can I just do one request. ldap and otp together?
Sorry, I’m pretty new to vault.


No, there is no way to bundle multiple requests into one.

Thank you so much.
Got it working!