Registry /
auth / auth0-go-jwt-middleware-v2
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/v2
Sets up JWT middleware to protect an endpoint.
package main
import (
"net/http"
"github.com/auth0/go-jwt-middleware/v2"
)
func main() {
m := jwtmiddleware.New(jwtmiddleware.Options{
ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
return []byte("secret"), nil
},
})
http.Handle("/protected", m.CheckJWT(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("ok"))
})))
}
Upgrade
Version history
2.3.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.