Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variable for bearer auth token #10824

Closed
wants to merge 2 commits into from
Closed

Add environment variable for bearer auth token #10824

wants to merge 2 commits into from

Conversation

hixichen
Copy link

@hixichen hixichen commented Feb 2, 2021

Our vault instances are behind company internal network with edge gateway that requires a valid bearer token.
Right now, we have to ssh into jump box to run the script with Vault.
It would be great that if Vault supports adding auth bearer token environment into http request header.

@vercel vercel bot temporarily deployed to Preview – vault-storybook February 2, 2021 17:34 Inactive
@vercel vercel bot temporarily deployed to Preview – vault February 2, 2021 17:34 Inactive
@vercel vercel bot temporarily deployed to Preview – vault February 2, 2021 17:35 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook February 2, 2021 17:35 Inactive
solsson added a commit to solsson/vault that referenced this pull request Aug 20, 2021
hashicorp#10824 rebased with naming
changed to that of hashicorp#5006

Fixes hashicorp#4982
and meets one use case mentioned in hashicorp#8754
@pmmukh pmmukh added the devex Developer Experience label Sep 10, 2021
@VinnyHC
Copy link
Contributor

VinnyHC commented Feb 1, 2022

In Vault 1.9 there are capabilities to define custom headers in the configuration, which I think will get you what you need! Depending on how you start Vault you can feed in an environment variable.
Quick snippet:

...

listener "tcp" {
  address     = "127.0.0.1:8200"
  custom_response_headers {
    "default" = {
      "Authorization" = ["Bearer ${BEARER_TOKEN}"],
    }
  }
}

...

Check out this tutorial Create Customized HTTP Headers for a more complete solution.
I'm going to close this PR but feel free to re-open if I misunderstood your request.

@VinnyHC VinnyHC closed this Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex Developer Experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants