Registry /
auth / auth0-go-jwt-middleware
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
jwtmiddleware
✓ github.com/auth0/go-jwt-middleware
Sets up a JWT middleware that protects an HTTP endpoint.
package main
import (
"net/http"
"github.com/auth0/go-jwt-middleware"
)
func main() {
middleware := jwtmiddleware.New(jwtmiddleware.Options{
ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
return []byte("secret"), nil
},
})
http.Handle("/protected", middleware.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK"))
})))
}
Upgrade
Version history
1.0.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.