auth0
Installation
SKILL.md
Auth0 Integration Skill
This skill provides standard patterns for integrating Auth0 into a polyglot stack. It focuses on secure OIDC flows, JWT verification in Go, and efficient React state management.
Architectural Standards
1. Go Backend Integration (JWT Validation)
- Verification: Use
auth0/go-jwt-middlewareandform3tech-oss/jwt-go. - JWKS Cache: Implement a caching mechanism for public keys from the
.well-known/jwks.jsonendpoint to reduce latency. - Claims Mapping: Map Auth0's
https://yourdomain.com/rolescustom claims to internal Go RBAC structures. Validate theaud(Audience) andiss(Issuer) claims strictly.
2. React Frontend Integration
- SDK: Use
@auth0/auth0-react. Wrap the application root inAuth0Provider. - Silent Refresh: Implement
getAccessTokenSilentlywithuseAuth0. UseignoreCache: trueonly when a fresh token is absolutely required for mutation. - Multi-tenant: Handle
organizationparameters in the login flow if using Auth0 Organizations.
3. TanStack Query Integration
const { getAccessTokenSilently, isAuthenticated } = useAuth0();