Registry / auth / auth0-go-jwt-middleware-v2

auth0-go-jwt-middleware-v2

JSON →
library2.3.1gogounverified

Middleware for validating Auth0-issued JWT tokens in Go HTTP servers.

go get github.com/auth0/go-jwt-middleware/v2
INSTALL
IMPORT
SIG · AUTH0-GO-JWT-MIDDL
A
auth0-go-jwt-middleware-v2
authgov2.3.1
harness data pending
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")) }))) }
Debug
Known issues
breakingVersion 2 uses a different API than v1; ensure you import the correct path.
fix
Use import path github.com/auth0/go-jwt-middleware/v2 for v2.
affects: >=2.0.0
Upgrade
Version history
2.3.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
auth0-go-jwt-middleware-v2 — go get auth0-go-jwt-middleware-v2 · libregistry