github.com/go-chi/jwtauth

jwtauth

JWT authentication middleware for Go HTTP services

95

Decision Signals

Health score 95/100, confidence 95/100.

Excellent
Maintenance 95
Adoption 100
Security 92
Maturity 100
Developer DX 77
Confidence 95

Install

go get github.com/go-chi/jwtauth

Package Data

updated May 29, 2026
Latest versionv1.2.0
Imported by697 packages
Stars640
Forks92
Last activity1 day ago
Latest releasev5.4.0 (3 months ago)
LicenseMIT
Known vuln records0

API Surface

30 symbols
SymbolKindSynopsis
JWTAuth Type type JWTAuth struct{}
JWTAuth.Decode Method func (ja *JWTAuth) Decode(tokenString string) (jwt.Token, error)
JWTAuth.Encode Method func (ja *JWTAuth) Encode(claims map[string]interface{}) (t jwt.Token, tokenString string, err error)
New Function func New(alg string, signKey interface{}, verifyKey interface{}) *JWTAuth
Authenticator Function func Authenticator(next http.Handler) http.Handler
EpochNow Function func EpochNow() int64
ErrAlgoInvalid Variable var ErrAlgoInvalid = errors.New("algorithm mismatch")
ErrExpired Variable var ErrExpired = errors.New("token is expired")
ErrIATInvalid Variable var ErrIATInvalid = errors.New("token iat validation failed")
ErrNBFInvalid Variable var ErrNBFInvalid = errors.New("token nbf validation failed")
ErrNoTokenFound Variable var ErrNoTokenFound = errors.New("no token found")
ErrUnauthorized Variable var ErrUnauthorized = errors.New("token is unauthorized")

Similar Packages

Go JWT Libraries

#1 golang-jwt

Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html

Go JWT Libraries 9.1K stars 15.1K imported-by 100% confidence
96

#2 pocketbase

Open Source realtime backend in 1 file

Go JWT Libraries 58.7K stars 544 imported-by 100% confidence
94

#3 hanko

Modern authentication, on your terms. Open source alternative to Auth0, Clerk, WorkOS, Stytch.

Go JWT Libraries 8.9K stars 0 imported-by 95% confidence
90

#4 jwt

Package jwt implements JSON Web Tokens as described in RFC 7519.

Go JWT Libraries 2.4K stars 0 imported-by 75% confidence
84

#5 jeff

Simple, flexible, secure, and idiomatic web session management with pluggable backends.

Go JWT Libraries 272 stars 2 imported-by 100% confidence
71