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

net/http example instead of Gin #49

Closed JessedeJonge closed 2 years ago

JessedeJonge commented 2 years ago

How about giving a sample with net/http instead?

sergiught commented 2 years ago

Hey @JessedeJonge! Thanks for raising this, we really appreciate your time!

I'm an engineer at @auth0 and we would love to gather a bit more insights into the issues you're having with our sample and how we can make it easier to navigate.

The web framework we use within the sample is https://github.com/gin-gonic/gin/ which is indeed not compatible with net/http however the middleware used for JWT validation is https://github.com/auth0/go-jwt-middleware which is net/http compatible and showcases in the examples how to set it up for that https://github.com/auth0/go-jwt-middleware/blob/master/examples/http-jwks-example/main.go.

Would you prefer us to use purely just the net/http mux router for setting up the routes or any compatible net/http router would work as well for you like e.g. https://github.com/go-chi/chi?

Looking forward to hearing back from you! And thanks for helping us make this better!:)