go-jwt-middleware
Use when securing Go HTTP API endpoints with JWT Bearer token validation, scope/permission checks, or stateless auth. Integrates github.com/auth0/go-jwt-middleware/v3 for REST APIs receiving access tokens from frontends or mobile apps. Also handles DPoP proof-of-possession token binding. Triggers on jwtmiddleware, go-jwt-middleware, Go API auth, JWT validation, CheckJWT.
Developer Setup
Setup & Installation
npx skills add https://github.com/auth0/agent-skills --skill go-jwt-middlewarenpx skills add https://github.com/auth0/agent-skills --skill go-jwt-middlewareOverview
What This Skill Does
Protect Go HTTP API endpoints with JWT access token validation using github.com/auth0/go-jwt-middleware/v3. > **Agent instruction:** Before providing SDK setup instructions, fetch the latest release version by running: > ```bash > gh api repos/auth0/go-jwt-middleware/releases/latest --jq '.tag_name' > ``` > Use the returned version in all dependency lines instead of any hardcoded version below.
Application
When to use this Skill
- Adding secure Auth0 authentication to a Go jwt middleware application
- Implementing standard login, logout, and token authentication flows in Go jwt middleware
- Managing user session state and securing frontend/backend routes using Auth0 SDKs
Documentation
Show Skills.md file
Go JWT Middleware Integration
Protect Go HTTP API endpoints with JWT access token validation using github.com/auth0/go-jwt-middleware/v3.
Agent instruction: Before providing SDK setup instructions, fetch the latest release version by running:
gh api repos/auth0/go-jwt-middleware/releases/latest --jq '.tag_name'Use the returned version in all dependency lines instead of any hardcoded version below.
Prerequisites
- Go 1.21 or higher
- Auth0 API configured (not Application - must be API resource)
- If you don't have Auth0 set up yet, use the
auth0-quickstartskill first
When NOT to Use
- Go server-rendered web applications - Use
go-auth0for session-based web apps - Single Page Applications - Use
auth0-react,auth0-vue, orauth0-angularfor client-side auth - Mobile applications - Use
auth0-swift,auth0-android, orauth0-react-native - Non-Go backends - Use
auth0-aspnetcore-apifor .NET,express-jwtfor Node.js
Recommendations