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

Support for decoding JWT #810

Closed
jeddeloh opened this issue Jan 17, 2023 · 3 comments · Fixed by #1025
Closed

Support for decoding JWT #810

jeddeloh opened this issue Jan 17, 2023 · 3 comments · Fixed by #1025

Comments

@jeddeloh
Copy link

I wonder if the JWT middleware should have the option to decode the token and push it onto the context after verifying?

@yusukebe
Copy link
Member

Hi @jeddeloh , thank you for the opinion. I'll consider it.

@metrue , how about this feature? I think we can do it with c.get/c.set functions.

@cd-slash
Copy link

cd-slash commented Feb 2, 2023

@jeddeloh I've put together a quick example for decoding asymmetric JWT here - that puts the JWT payload into the context. You could maybe reuse that pattern for the existing (symmetric) JWT middleware?

@jeddeloh
Copy link
Author

jeddeloh commented Feb 2, 2023

Thank you, @cd-slash! I've already written a small middleware for my needs, so I'm good to go. This ticket was only intended to propose a possible change to current JWT middleware.

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

Successfully merging a pull request may close this issue.

3 participants