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

Allow stdin input for github auth token - feature request #3459

Open
james-portman opened this issue Oct 16, 2017 · 6 comments
Open

Allow stdin input for github auth token - feature request #3459

james-portman opened this issue Oct 16, 2017 · 6 comments

Comments

@james-portman
Copy link

james-portman commented Oct 16, 2017

Feature Request:

Expected Behavior:
It would be nice for vault auth -method=github to take input/stdin from the user to provide their token, in the same way vault auth currently does.

Actual Behavior:

# vault auth -method github
GitHub token should be provided either as 'value' for 'token' key,
or via an env var VAULT_AUTH_GITHUB_TOKEN
# vault auth
Token (will be hidden): 

(waits for input)

@jefferai
Copy link
Member

You can do this now by simply using a vault write command instead of vault auth. Simply use auth/<mount>/login and pass in token=-.

@james-portman
Copy link
Author

Thanks for the alternate method.
It is still not very user friendly as they will need to type ctrl-D to end input rather than enter.
I was hoping that since the behaviour was already implemented in the default token auth that it would be possible to apply for Github auth too.

@boxrick
Copy link

boxrick commented Oct 16, 2017

This is something that I use myself but have had to write a small wrapper to make it work as expected.

Odd how there isn't consistent behaviour between the same command when simply specifying a different behaviour.

@jefferai
Copy link
Member

It's possible, but if you're willing to give it a go a PR will make it happen much faster :-)

@jefferai
Copy link
Member

@boxrick it's not actually the same command -- auth backends can define CLI helpers, and it's up to the CLI helper to decide how values should be passed in (if at all).

@jordansissel
Copy link

I found that can pass token=- to vault login similar to how token=- is suggested above for vault write

% echo "my github token" | vault login -method github token=-
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
...

@catsby catsby added feature-request core Issues and Pull-Requests specific to Vault Core auth/github enhancement and removed core Issues and Pull-Requests specific to Vault Core feature-request labels Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants