-
Notifications
You must be signed in to change notification settings - Fork 206
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
Sample not working - ValidationKeyGetter - cannot use as jwt.Keyfunc value in struct literal #95
Comments
Thanks for surfacing this issue @b-venter. We'll get this fixed! |
I did a bit more exploring and this seems linked to the NOTE of this repository: the unmaintained jwt library. To test, I cloned the jwtmiddleware.go file, and changed the jwt library to github.com/golang-jwt/jwt. This appears to have solved the problem I was experiencing, but I am not sure if it will introduce an incompatibility elsewhere? At least for the tutorial, it did not appear to introduce further issues. If you want to give it a quick test, I put it together for easy running at https://github.com/b-venter/auth0-go-jwt for now. |
Yes, you are on the right track there. Pulling in |
Actually, I removed |
Yeah, it's from that change (see #69 for more details). form3tech was added because there was no other fix at that point. Since then the community has rallied around golang-jwt. We've got a new version of this package coming out very soon and it uses golang-jwt instead of form3tech. If you're interested in checking it out, https://github.com/auth0/go-jwt-middleware/tree/v2 should point you in the right direction. Using golang-jwt for validation is not in the README, but you can find an example in that branch here: https://github.com/auth0/go-jwt-middleware/blob/v2/validate/jwt-go/examples/main.go |
Thanks @grounded042! The support has been great - which is why I chose to explore Auth0 more in the first place! :) |
@b-venter happy to help! Yes, go ahead and close this since we've solved it for you. I've got a PR open to fix quickstarts code: auth0-samples/auth0-golang-api-samples#35. And yes, this was the same issue faced in that issue as well. Thanks for bringing this to our attention! |
Description
Reproduction
go mod init test
Open with VS Code and the error will appear.
Environment
I hope I have not missed something obvious. I tested and the function is acceptable to jwt.Parse (which also takes a jwt.Keyfunc type). Please help! :)
The text was updated successfully, but these errors were encountered: