
go-jwt-middleware
A Middleware for Go Programming Language to check for JWTs on HTTP requests
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 freeFree: 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
Get tools like this every Wednesday
One featured tool, three on the radar. No fluff.
A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores
Trust Signals
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
openclaw
Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞
392.8k ★everything-claude-code
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
286.7k ★DeepSeek Harness
DeepSeek Harness: Everything is a Plugin.
258.6k ★