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

API /sys/generate-root #5236

Closed
devabuse opened this issue Aug 31, 2018 · 5 comments
Closed

API /sys/generate-root #5236

devabuse opened this issue Aug 31, 2018 · 5 comments
Labels
core Issues and Pull-Requests specific to Vault Core devex Developer Experience feature-request
Milestone

Comments

@devabuse
Copy link

Hi,

I'm trying to generate a new root token using the API. This works but returns an encoded_token. I am using an otp to call the /sys/generate/root/attempt.

The CLI interface provides a method to decode the root roken with the otp, but how do I do this using the rest API?

Thanks.

Regards,
Mike

@chrishoffman
Copy link
Contributor

There is not one currently but may add one in the future. The process of decoding the token is a relatively simple XOR of the bytes of the OTP against the bytes of the token.

See https://github.com/hashicorp/vault/blob/master/command/operator_generate_root.go#L338-L348.

@chrishoffman chrishoffman added this to the 0.11.1 milestone Aug 31, 2018
@devabuse
Copy link
Author

Thank you. I will figure this out on my end.

@jefferai jefferai modified the milestones: 0.11.1, 0.11.2 Sep 1, 2018
@chrishoffman chrishoffman modified the milestones: 0.11.2, near-term Oct 1, 2018
@catsby catsby added feature-request core Issues and Pull-Requests specific to Vault Core labels Nov 8, 2019
@pbernal pbernal modified the milestones: near-term, triaged May 28, 2020
@raskchanky
Copy link
Contributor

I'm going to close this for now, since it looks like there's not much here for us to do. Feel free to reopen if you want to discuss further.

@PayalSasmal10
Copy link

Hi , could anyone know how to decode this encoded_root_token, i am unable to do this.

@mrioqueiroz
Copy link
Contributor

Hi , could anyone know how to decode this encoded_root_token, i am unable to do this.

This Node.js module may help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues and Pull-Requests specific to Vault Core devex Developer Experience feature-request
Projects
None yet
Development

No branches or pull requests

9 participants