Announcing Go-JWT-Middleware V3.0 #378
developerkunal
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're pleased to announce the release of Go-JWT-Middleware v3.0. This major release brings modern Go patterns, enhanced security features, and improved developer experience to JWT authentication in Go.
What's New in V3
Pure Options Pattern
V3 adopts a pure functional options pattern across all components, making the API self-documenting and easier to use with IDE autocomplete.
Before (v2):
Now (v3):
Type Safety with Generics
V3 uses Go generics for type-safe claims retrieval, eliminating runtime type assertions.
Before (v2):
Now (v3):
DPoP Support (RFC 9449)
V3 introduces support for Demonstrating Proof-of-Possession (DPoP), which helps prevent token theft and replay attacks.
Modern JWT Library
V3 migrates from
square/go-josetolestrrat-go/jwx v3, an actively-maintained library with modern Go support.Expanded Algorithm Support
V3 now supports 14 signature algorithms including EdDSA (Ed25519) and ES256K.
Core-Adapter Architecture
V3 introduces a framework-agnostic core package that enables reusable validation logic across different transports (HTTP, gRPC, etc.).
Additional Improvements
WWW-Authenticateheaderslog/slogQuick Start
Installation
Basic Example
Breaking Changes
GetClaims[T]()helper function insteadExtractedTokenwith scheme instead of plain stringExclusionURLHandler(notExclusionUrlHandler)Migration from V2
We've made migration straightforward with a comprehensive Migration Guide.
Key Steps:
v2tov3GetClaims[T]()instead of context valueNote: You can run v2 and v3 side-by-side during migration.
Examples
Working examples for popular frameworks:
Resources
Feedback
We'd love to hear your feedback on v3. Star the repo, join the discussion below, or contribute to make it even better!
Go-JWT-Middleware v3.0 - Secure, Modern, Developer-Friendly
Documentation • Migration Guide • Examples
Beta Was this translation helpful? Give feedback.
All reactions