peopledoc / vault-cli

A configurable command-line interface tool (and python library) to interact with Hashicorp Vault
https://vault-cli.readthedocs.io/
Other
81 stars 21 forks source link

Support LDAP Authentication #184

Open MarkRx opened 3 years ago

MarkRx commented 3 years ago

I've read the documentation and looked through the code but I don't see a way to set the authentication to use the ldap method. Is this supported? It might simply be a tweak to the authentication mechanism to grab a token to use a different body and url.

The curl command to authenticate with LDAP looks like this:

VAULT_TOKEN=$(curl -s -S \
    --request POST \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "X-Vault-Namespace: $NAMESPACE" \
    --data @<(/usr/bin/cat <<< "{\"password\":\"$VAULT_PASSWORD\"}") \
    "$VAULT_URL/v1/auth/ldap/login/$USERNAME" \
    | jq -j .auth.client_token)
ewjoachim commented 3 years ago

You're right, it's currently unsupported. Are you interested in making a contribution ? I'd be happy to help :)