Cannot login with dev server

I am testing Vault policies and username based authentication on a local dev server. I created a userpass based user successfully but when I try to login I’m receiving an error.

~ % vault login -method=userpass username=kbreit password=passhere
Error authenticating: Error making API request.

URL: PUT http://127.0.0.1:8200/v1/auth/userpass/login/kbreit
Code: 400. Errors:

* missing client token

Searching shows it may be because I’m not specifying a namespace, but namespaces are specific to Vault Enterprise. Also, the basic tutorial (Userpass - Auth Methods | Vault by HashiCorp) doesn’t show a namespace. The root token is assigned to $VAULT_TOKEN. Please let me know what I am doing incorrectly. Thank you.

get a list of your env variables that have VAULT in them:

$ env | grep -i VAULT 

What does vault auth list --detailed show?

I deleted all env vars related to vault and restarted the server and it worked. Thank you.

1 Like