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

Fix JwtProvider wrong error message for Helidon 3.x #4136

Merged
merged 4 commits into from
May 4, 2022

Conversation

dalexandrov
Copy link
Contributor

As agreed with @arjav-desai, the current message is wrong. There is already Jwt#addAudienceValidator function, where audience is validated. We can rely on its messages.

Resolves #3912 for Helidon 3.x

@dalexandrov dalexandrov self-assigned this Apr 18, 2022
@dalexandrov dalexandrov added security P3 3.x Issues for 3.x version branch labels Apr 18, 2022
@alaytonoracle
Copy link

alaytonoracle commented Apr 26, 2022

Hi, I logged the original bug. I don't think the proposed fix is right.

It should be "return failOrAbstain(validate.toString());" , not "errors.toString()".

At that point it needs to report the errors from the "Errors validate = jwt.validate(null, expectedAudience)" call (not from the Errors errors = signedJwt.verifySignature(verifyKeys, defaultJwk) call ).

Thanks.

@dalexandrov
Copy link
Contributor Author

Ah, you are right! Thank you :)

@dalexandrov dalexandrov merged commit 7905dd2 into helidon-io:master May 4, 2022
@dalexandrov dalexandrov deleted the 3912_wrong_jwt_message branch May 4, 2022 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch P3 security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JwtProvider returns wrong error message for expired tokens
3 participants