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

WithConfig is not validating jwt by default settings #1

Open
kunKun-tx opened this issue Sep 22, 2022 · 0 comments
Open

WithConfig is not validating jwt by default settings #1

kunKun-tx opened this issue Sep 22, 2022 · 0 comments

Comments

@kunKun-tx
Copy link

Describe the bug

Currently there is no ValidateOptions in the DefaultConfig, and the WithConfig function will only validate the token where there is at least one validation option. This leads to expired token passing through the middleware.

Is there any particular reason I missed that we don't set jwt.WithValidate(true) by default?

if len(config.ValidateOptions) > 0 {
options = append(options, jwt.WithValidate(true))

To Reproduce / Expected behavior
Current: Run the server with this middleware and start a request with a valid but expired token, the middleware will accept it.

Expected: throw 401 with message=invalid or expired jwt, internal=exp not satisfied"

Additional context
Thank you for the marvelous jwx project and this great example. Helped me a lot on how to use jwx with Echo.

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

1 participant