Registry / auth / appleboy-gin-jwt-v2

appleboy-gin-jwt-v2

JSON →
library2.10.3gogounverified

JWT authentication middleware for the Gin web framework.

go get github.com/appleboy/gin-jwt/v2
INSTALL
IMPORT
SIG · APPLEBOY-GIN-JWT-V
A
appleboy-gin-jwt-v2
authgov2.10.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jwt
github.com/appleboy/gin-jwt/v2

Sets up JWT authentication with a login endpoint.

package main import ( "github.com/gin-gonic/gin" jwt "github.com/appleboy/gin-jwt/v2" ) func main() { r := gin.Default() authMiddleware, _ := jwt.New(&jwt.GinJWTMiddleware{ Realm: "test zone", Key: []byte("secret key"), Timeout: jwt.DefaultTimeout, MaxRefresh: jwt.DefaultMaxRefresh, }) r.POST("/login", authMiddleware.LoginHandler) r.Run() }
Debug
Known issues
breakingv2 has breaking changes from v1, including configuration struct changes.
fix
Use GinJWTMiddleware struct with new fields; update imports to /v2.
affects: >=2.0.0
Upgrade
Version history
2.10.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
34
Resources
appleboy-gin-jwt-v2 — go get appleboy-gin-jwt-v2 · libregistry