Tools/auth0/go-jwt-middleware

go-jwt-middleware

A Middleware for Go Programming Language to check for JWTs on HTTP requests

1.2k ★+1/wkemergingGoMIT License →trending

The Lens

By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.

Updated Oct 2026

go-jwt-middleware is Auth0's bouncer for Go APIs: wrap a handler, and any request without a valid, correctly signed JSON Web Token gets a 401 before your code runs. It isn't tied to Auth0. Any issuer that publishes signing keys works, Okta or your own included. MIT licensed, free.

Use v3: go get github.com/auth0/go-jwt-middleware/v3. It shipped January 2026, reached v3.4 in October, moved to the lestrrat-go/jwx library and added gRPC interceptors and DPoP proof-of-possession tokens. It also caches key fetches, handles multi-tenant issuers and ships Gin, Echo and Iris examples. The README says Go 1.24+, but go.mod has required Go 1.25 since v3.2. v2 last shipped in November 2025.

Versus golang-jwt directly: golang-jwt parses and verifies tokens, then you add keyfunc for key sets and write the middleware and error responses yourself. Fine for one internal service signing its own tokens. Trusting an outside identity provider? This saves the boilerplate. Free at every team size; your identity provider is the bill.

The catch: DPoP doesn't track proof IDs yet, so a captured proof can be replayed for about five minutes unless you record jti values yourself. Auth0 documents it plainly. Read it before claiming DPoP on a security review.

Free vs Self-Hosted vs Paid

fully free

Free: Everything. MIT licensed Go module (github.com/auth0/go-jwt-middleware/v3), no paid edition, works with any JWT issuer that publishes a JWKS endpoint, not just Auth0.

Self-hosted: Nothing to host: it compiles into your Go service. Needs Go 1.25 or newer per go.mod (the README still says 1.24+). Net/http middleware plus a gRPC interceptor; Gin, Echo and Iris have example integrations.

Paid: No paid tier for the library. Whatever issues your tokens costs money if it's a hosted identity provider like Auth0 or Okta; self-issued HMAC tokens cost nothing.

Free and MIT licensed at any scale. The real cost is your identity provider, and this library works with any of them.

What to do by team size

Solo
free; golang-jwt alone is fine if you sign your own tokens
Small team
free; saves writing JWKS caching and error handling
Medium team
free; use the multi-issuer providers for multi-tenant APIs
Large team
free; add your own jti replay store before relying on DPoP
Self-hosting ops:trivial

Get tools like this every Wednesday

One featured tool, three on the radar. No fluff.

Score
74/100 · B+
Adoption13/30
Maintenance25/25
Community11/20
License15/15
Analysis10/10

A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores

Trust Signals

Community discussions enabledOrganization account (346 public repos)Notable author: 2,161 followers

License: MIT License

Use freely, including commercial. Just keep the license.

Commercial use: ✓ Yes

About

Owner
Auth0 (Organization)
Stars
1,208
Forks
212

Explore Further

More tools in the directory