# appleboy/gin-jwt

JWT Middleware for Gin framework

Repository: https://github.com/appleboy/gin-jwt
Canonical: https://ross.abutalabs.com/products/gin-jwt
Language: Go
License: MIT
License Family: permissive
Topics: gin, jwt-middleware, gin-gwt
Last push: 2026-08-15T02:59:43+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 79, longevity 100
- inputs: {"age_days": 3821, "days_push": 18, "days_rel": 141, "gap_med": 26.0, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2973, forks 386 (observed 2026-08-28T04:07:32.873023+00:00)

## What it is
A JWT authentication middleware for the Gin web framework in Go, built on golang-jwt/jwt. It provides login handling, token refresh, and role-based authorization with configurable parsing options.

## Use cases
- add jwt authentication to a gin api
- implement login and token refresh in go
- protect gin routes with role-based authorization
- support multiple jwt providers in one middleware
- integrate oauth sso with gin
- store jwt tokens in redis for revocation

## When to choose
- you use the Gin framework and need JWT auth
- you want battle-tested middleware with active maintenance
- you need flexible claims validation and multi-provider support

## When to avoid
- you use a framework other than Gin
- you need a full identity provider or user management system
- your app is not in Go

## Facets
- artifact type: library
- maturity: active
- function: auth, middleware, security
- domain: web-development, backend, security, apis
- platform: go, cli
- tags: jwt, gin, authentication, token-refresh, oauth, golang, web-server

## Member repositories
- appleboy/gin-jwt (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.873023+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:31:36.982661+00:00, confidence not recorded.
  - readme: https://github.com/appleboy/gin-jwt (fetched 2026-08-28T04:07:32.873023+00:00, sha fc7d3941c60b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
