Go quickstart
Add Wocha authentication to a Go HTTP server with JWT access token validation middleware and wocha-go for Management API calls.
Add Wocha authentication to a Go HTTP server: validate JWT access tokens with middleware and use wocha-go for Management API calls.
Prerequisites
- Go 1.21+
- A Wocha project with an OAuth application (Wocha Console)
What you'll build
A Go HTTP server with JWKS-backed JWT middleware and Management API client calls.
your-app.local
Welcome back
After sign-in
✓ Session stored securely
✓ User profile available in your app
✓ Organisation context ready for multi-tenant features
Installation
Environment variables
JWT middleware
Create middleware/auth.go:
Protected handler
Create main.go:
Testing the integration
-
Run the server:
-
Obtain an access token from your frontend or hosted login.
-
Call the protected endpoint:
Next steps
- SDK reference — hooks, server helpers, and configuration options
- Webhooks overview — receive user and session lifecycle events
- Common patterns — protect routes, org switching, and role-based UI