Skip to main content

Authentication

Igris supports several authentication methods depending on the context.

Session Cookies (Dashboard)

When you log in through the dashboard, Better Auth sets a session cookie. The cookie name depends on the environment:
  • Production: __Secure-igris.session_token (Secure flag set, HTTPS only)
  • Development: igris.session_token
This cookie is automatically sent with all dashboard requests. For API calls from a browser context, include credentials:
Or pass the cookie explicitly:

Sign-in options

Email and password

New email/password accounts must verify their email address before the first sign-in. Igris sends a verification link when you sign up. Sign-in is rate limited to 5 attempts per 5 minutes, and password-reset requests have the same limit.

OAuth (GitHub / Google)

GitHub and Google sign-in are optional and depend on how the server is configured. The buttons appear on the sign-in page only when the deployment sets GITHUB_CLIENT_ID/GITHUB_CLIENT_SECRET or GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET. If you don’t see a button, your deployment doesn’t have that provider enabled. OAuth sessions are issued as session cookies identical to email/password login.

Two-factor authentication

Two-factor authentication requires the Growth plan or higher. On a lower plan, requests to the two-factor auth endpoints return 403 with plan_feature_unavailable (see Error responses).

API Keys (Programmatic Access)

For MCP proxy connections and CI/CD integrations, use API keys.

Creating an API Key

  1. Go to Settings → API Keys in the dashboard
  2. Click Generate Key
  3. Give it a label (e.g., “Proxy - Production”, “CI Pipeline”)
  4. Copy the key — it’s only shown once
API keys follow the format ig_ followed by 48 lowercase hex characters (24 random bytes), for a total of 51 characters:

Using an API Key

Pass the key in the Authorization header:

Key Scoping and Permissions

A management API key has no scopes of its own. It acts with the current role of the member who created it, including that member’s per-member permission overrides. If the creator’s role can write policies, the key can POST, PATCH and DELETE policies. If it can’t, the request gets 403 Forbidden.
  • If the creator is removed from the organization, the key stops working and returns 401.
  • A key with no recorded creator is rejected by every permission-guarded route.
  • If you change the creator’s role later, the key follows the new role.
Keys are scoped to the organization they were created in. See Roles and permissions for what each role can do.

Revoking Keys

Revoke a key in Settings → API Keys by clicking Revoke. You can revoke keys you created. Only an Owner or Admin can revoke a key created by someone else. Revoked keys immediately stop working: any request using that key receives 401 Unauthorized. The API Keys tab is visible only to members with the api-keys:write permission.

Ingest API Authentication

The Ingest API (/api/v1/ingest/*) verifies keys through BetterAuth’s API-key check, which is separate from the management-key check described above. Pass the key as Authorization: Bearer <key>. The endpoints are POST /api/v1/ingest (raw JSON), /api/v1/ingest/portkey, /api/v1/ingest/helicone and /api/v1/ingest/cloudflare. Log ingestion requires the Growth plan or higher, and it counts against your monthly log quota (over quota returns 429).

MCP Gateway and LLM Gateway Authentication

The MCP gateway (/v1/mcp/:slug) and LLM gateway (/llm/:slug/*) use Bearer API key only. Session cookies are not accepted on these routes.
  • CORS: Both routes allow wildcard origins (*) and answer preflight requests (GET, HEAD, POST, OPTIONS) — designed for programmatic clients and browser-based SDKs calling from any origin.
  • No session cookie fallback: There is no session-cookie auth path on gateway routes; the Bearer key is the only accepted credential.

Organization Context

All API requests are scoped to an organization. The organization is determined by:
  1. Session cookies — the user’s active organization in their session
  2. API keys — the organization the key was created in

Error Responses

The body of a 401 depends on which surface you called. A plan-gated 403 has two shapes. Most routes (policies, audit events, detectors, webhooks, and the two-factor auth endpoints) return:
A smaller set of routes return:
Plan limits (policy count, rules per policy, body retention) return a 403 with "code": "PLAN_LIMIT_REACHED" plus the limit, your current value, the plan maximum and upgradeTo. See Limits and errors.

Limits

See Limits and errors for the full list, including the environment variables that tune the gateway limits on self-hosted deployments.

RBAC Roles

Permissions are enforced based on the member’s role in the organization. This table covers the main resources only. Roles also control alerts, audit, reports, HIPAA, SOC 2, SSO, settings and AI systems. Owners and Admins can also grant or revoke individual permissions for a single member. Those per-member overrides apply to API keys that member created. See Roles and permissions for the full permission matrix.