auth0-samples / auth0-golang-api-samples

Auth0 Integration Samples for Go REST API Services
https://auth0.com/docs/quickstart/backend/golang
MIT License
129 stars 67 forks source link

Feat: add log output #37

Closed Casper-Mars closed 3 years ago

Casper-Mars commented 3 years ago

add log output when parse token fail

sergiught commented 3 years ago

Hey @Casper-Mars , we really appreciate your contribution!

However if you will pull the latest code from master this change is no longer needed.

We were parsing the jwt token twice, once in the middleware (with jwt.MapClaims) and once inside the checkScope (with CustomClaims), this lead to a bug where we couldn't unmarshall the audience because of incompatible types (reference PR: https://github.com/auth0-samples/auth0-golang-api-samples/pull/39 and also fixes issue https://github.com/auth0-samples/auth0-golang-api-samples/issues/36, root issue: https://github.com/auth0/go-jwt-middleware/issues/81) and it was also unnecessary to do twice.

Please let us know in case you encounter any other issues!