-
-
Notifications
You must be signed in to change notification settings - Fork 164
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 function to check if jws.Verify
failed with verifyError
or not
#1048
Comments
Better error reporting for jws.Verify is something that I'm absolutely 👍 for, but I'm not 100% as to exactly what you're going after. For example,
What does this (jwk.Fetch) have to do with Perhaps... are you dynamically loading keys in a KeyProvider? And this is failing and you want to differentiate against this line? (If this is the case I can certainly accept a PR with your proposed change, as long as there are test cases included :) |
I do
That's why I'm almost 100% sure, that if jws.Verify is failing, it is due to invalid signature, because token was parsed and keySet should be valid as it is returned by So I would like to differentiate basically any error from |
Okay, so your proposed changes for |
@arxeiss I got other stuff that I also need to fix on this module, so I'll work on this now |
@arxeiss Please check #1049. I opted to rename the function |
You were much faster than I'm. I had to focus to different task so I put this on hold. I checked the PR, seems good. Thank you |
Abstract
If I use
jws.Verify
and it fails, it is hard to know why. If signature is invalid, I would like to return Unauthenticated/Invalid argument error. In all other cases I would like to return just Internal error and log that error.If I got keys from
jwk.Fetch
and similar, I might be almost 100% sure that issue is because of invalid signature.But would be nice to know that for sure.
Describe the proposed solution/change
Something similar like https://github.com/lestrrat-go/jwx/blob/develop/v2/jwt/validate.go#L147 or just simple helper
The text was updated successfully, but these errors were encountered: