Forgecroft Docs
Guides / Auth

Authentication

How users and systems authenticate to Forgecroft — OAuth, sessions, and API keys.

Forgecroft supports two authentication flows: OAuth for users and API keys for automation.

User Authentication

Users sign in through OAuth providers (GitHub or Google). After successful authentication, Forgecroft issues a session JWT stored in an fc_session cookie.

OAuth Flow

  1. Navigate to /auth/github or /auth/google to start the OAuth flow
  2. You are redirected to the provider to authorize
  3. After authorization, Forgecroft exchanges the code for a token, fetches your identity, and creates or links your account
  4. A session cookie is set and you are redirected to the console

If you don’t have an organization yet, you’ll be directed to create one via POST /auth/new-account.

Session Management

Multi-Org Support

A single user account can belong to multiple organizations. Use GET /me to see all your memberships and POST /auth/switch-org to switch context.

API Key Authentication

API keys authenticate automated systems. They are passed via the Authorization: Bearer header.

Authorization: Bearer fc_live_abc123...

API keys have three dimensions of scoping:

See the API Keys guide for details on creating and managing keys.

Authentication Levels

Different endpoints require different auth levels:

LevelMethodsUse case
NoneNo auth requiredOAuth start, webhook handlers, Rego playground
User authJWT or cookie onlyAccount management, org switching
Org authJWT, cookie, or API keyMost API operations
Runner tokenX-Runner-Token headerRunner callbacks (internal)