Closed b-venter closed 3 years ago
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 github.com/form3tech-oss/jwt-go
should fix the issue.
Actually, I removed github.com/form3tech-oss/jwt-go
and put in github.com/golang-jwt/jwt
. I guess this error is a further symptom of #73 ?
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! :) I suspect the above will also address the matter for #96. Should close this issue?
@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: https://github.com/auth0-samples/auth0-golang-api-samples/pull/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! :)