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

newVerifier() function - verificationKey type #255

Open
6 tasks done
juan-rojas-soteria opened this issue Mar 6, 2024 · 0 comments
Open
6 tasks done

newVerifier() function - verificationKey type #255

juan-rojas-soteria opened this issue Mar 6, 2024 · 0 comments
Labels
bug This issue reports a suspect bug or issue with the SDK itself

Comments

@juan-rojas-soteria
Copy link

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this SDK and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

After updating the library from version github.com/auth0/go-jwt-middleware/v2 v2.1.0 to github.com/auth0/go-jwt-middleware/v2@v2.2.1, an error was detected in the validation of a JWT that worked correctly in version v2.1.0. Specifically, the function func newVerifier(verificationKey interface{}) (payloadVerifier, error) has problems in the switch case fragment where it compares the encryption algorithm. I compared the type of interface that you get in the two versions of the library and they are different. I attach images for reference. Version v2.2.1 does not have the same type as version v2.1.0, therefore the process is not able to determine the algorithm and breaks

v2.1.0:

v2 1 0

v2.2.1:

v2 2 1
.

Reproduction

  1. Given a JWT generated using /oauth/token with a RS256 signature algorithm
  2. When consuming a REST endpoint created using golang (v1.20 and v.1.22) and gin
  3. Then I get in the response: Encountered error while validating JWT: jwt invalid: failed to deserialize token claims: could not get token claims: go-jose/go-jose: unsupported key type/format

Go JWT Middleware version

github.com/auth0/go-jwt-middleware/v2@v2.2.1

Go version

1.20 / 1.22

@juan-rojas-soteria juan-rojas-soteria added the bug This issue reports a suspect bug or issue with the SDK itself label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports a suspect bug or issue with the SDK itself
Projects
None yet
Development

No branches or pull requests

1 participant