auth

Generate JWT and API key authentication middleware with RBAC and tenant scoping.

4|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/reliant-labs/forge --skill auth-reliant-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth
Source: https://github.com/reliant-labs/forge/tree/main/internal/templates/project/skills/forge/auth
Command: npx skills add https://github.com/reliant-labs/forge --skill auth-reliant-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT authentication and API key authorization in my backend services?

JWT authentication and API key authorization are implemented by configuring providers in forge.yaml and generating auth middleware. You can enforce unauthenticated allow-lists and apply RBAC rules using proto method annotations to secure backend services.

What is the best way to enforce role-based access control across RPC methods?

Role-based access control is enforced by marking RPC methods with required_roles using proto options. Running code generation produces the authorizer middleware that validates user roles against the annotated access rules for each method.

How does multi-tenant isolation work with JWT claims for database queries?

Multi-tenant isolation works by extracting tenant IDs from specific JWT claim fields. The system automatically scopes generated CRUD database queries using explicitly marked tenant_key fields to ensure strict data separation between tenants.

Can I use both JWT and API keys to secure my APIs at the same time?

Yes, you can configure both JWT and API key authentication simultaneously via forge.yaml. The system generates unified middleware that standardizes authentication payloads into a shared Claims struct, including user_id, email, and org_id, regardless of the token type.

How do I allow unauthenticated requests to specific API endpoints?

You can allow unauthenticated requests to specific endpoints by configuring an unauthenticated allow-list. This requires defining the excluded paths in your configuration before generating the auth middleware to bypass token validation for those routes.

Do I need an auth-ui pack to handle login and signup flows for JWT authentication?

An auth-ui pack is required if you need frontend login and signup components. It wires session UI components directly to your selected backend JWT provider, but the backend middleware itself functions independently for API security.