Registry /
web-framework / iris-contrib-middleware-jwt
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/iris-contrib/middleware/jwt
Protect a route with JWT authentication
package main
import (
"github.com/kataras/iris/v12"
"github.com/iris-contrib/middleware/jwt"
)
func main() {
app := iris.New()
j := jwt.New(jwt.Config{
ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
return []byte("secret"), nil
},
})
app.Get("/protected", j.Serve, func(ctx iris.Context) {
ctx.WriteString("Hello authenticated user")
})
app.Listen(":8080")
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20251225090426-92c6f28facdalatest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.