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

expose header data #94

Open
davidje13 opened this issue Apr 19, 2019 · 1 comment
Open

expose header data #94

davidje13 opened this issue Apr 19, 2019 · 1 comment

Comments

@davidje13
Copy link

Currently it is possible to extract the payload using decode, but this does not include the header information.

For the use-case of a token which specifies the name of a key used to sign it, it is important to be able to extract this key name from the token in advance to know which key to provide to decode for verification. Specifically, this relates to Google's "web sign in" JWT (where 2 keys are valid at any time to allow key rotation). This could be handled by trying both keys, but that is inefficient and unnecessarily reduces security.

Alternatively this library could be updated to optionally consume a dictionary of key-name -> key, and check the kid property of the header.

From what I can tell, the only existing option is to manually decode the header part of the token, which seems wasteful since this library already has the necessary code.

@dtb
Copy link

dtb commented Jun 18, 2019

@hokaccha or @alexjab would you be interested in a PR around this, or do you have any feedback for #72? I'm affected by this as well, and might be able to work on a PR if there was a chance you'd merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants