Authentication
Forgecroft has two authentication methods: OAuth sessions for interactive users and API keys for automation.
User Authentication (OAuth)
Section titled “User Authentication (OAuth)”Users sign in through GitHub or Google OAuth.
- Navigate to
/auth/githubor/auth/google. - Authorize with the provider.
- Forgecroft exchanges the authorization code for a token, fetches your identity, and creates or links your account.
- A session cookie is set and you are redirected to the console.
If you have no organization yet, you are directed to create one via POST /auth/new-account.
Sessions
Section titled “Sessions”After OAuth completes, Forgecroft issues a JWT stored in an fc_session cookie (HttpOnly, Secure). This JWT is your session — every authenticated request includes it automatically.
- Switch organization:
POST /auth/switch-org(a single user account can belong to multiple organizations) - View memberships:
GET /mereturns your profile and all org memberships - Log out:
POST /auth/logoutincrements your session version, which invalidates all existing JWTs immediately — not just the current browser - Delete account:
DELETE /auth/accountcascades to org cleanup
API Key Authentication
Section titled “API Key Authentication”API keys authenticate automated systems: CI pipelines, the CLI, and coding agents. Pass them via the Authorization header:
Authorization: Bearer fc_live_abc123...API keys have three dimensions of scoping:
- Scope type:
org(all resources) orproject(one project) - Action scope:
read,write, oradmin - Capability scopes: fine-grained permissions like
api_keys:read,members:write,billing:read
See the API Keys guide for creating and managing keys.
Authentication Levels
Section titled “Authentication Levels”Different endpoints require different credentials:
| Level | Method | Use case |
|---|---|---|
| None | No auth required | OAuth start, webhook handlers |
| User auth | Session JWT only | Account management, org switching |
| Org auth | Session JWT or API key | Most API operations |
Related Endpoints
Section titled “Related Endpoints”GET /auth/providers— available OAuth providersGET /me— current user profile and org membershipsPOST /auth/switch-org— switch org contextPOST /auth/logout— invalidate all sessionsGET /whoami— identity and scope info (works with both sessions and API keys)