What problem does it solve?
Forge’s auth skill removes the complexity of building consistent authentication, authorization, and tenant scoping by generating the required middleware and enforcing your access rules from forge.yaml and proto annotations.
Core Features & Use Cases
- Configurable Auth Providers: Choose JWT, API keys, both, or none via forge.yaml, including signing/JWKS settings and API key header configuration.
- Unified Claims & Context Access: Standardize authentication payloads through a shared Claims struct (user_id, email, org_id, roles) and retrieve them safely from request context.
- Authorization with RBAC Annotations: Enforce role-based access by marking RPC methods with required_roles (via proto options) and regenerating authorizers.
- Multi-Tenancy Isolation: Enable tenant extraction from claims and automatically scope generated CRUD queries using explicitly marked tenant_key fields.
- Frontend Auth UI Pairing: Install an auth-ui pack that wires login/signup/session components to the selected backend provider.
Quick Start
Configure forge.yaml to enable JWT or API-key auth, then run forge generate to produce the middleware wiring and RBAC/tenant authorizers.