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 Jun 11, 2026
Latest versionv1.2.0
Imported by697 packages
Stars641
Forks92
Last activity14 days 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 HTTP Routers

#1 Chi

Package chi is a small, idiomatic and composable router for building HTTP services.

Go HTTP Routers 22.3K stars 0 imported-by 45% confidence
88

#2 Gorilla Mux

Package mux implements a request router and dispatcher.

Go HTTP Routers 21.8K stars 99.5K imported-by 100% confidence
80

#3 httprouter

Package httprouter is a trie based high performance HTTP request router.

Go HTTP Routers 17.1K stars 27.4K imported-by 100% confidence
80

#4 bunrouter

Golang HTTP router

Go HTTP Routers 780 stars 141 imported-by 60% confidence
75

#5 lars

Package lars - Library Access/Retrieval System, is a fast radix-tree based, zero allocation, HTTP router for Go.

Go HTTP Routers 384 stars 66 imported-by 100% confidence
67