Auth API reference

Auth API · Consumer-Oauth-Sign-In

post/{app_slug}/v1/auth/oauth/{provider}/callback

Provider callback (Apple uses `response_mode=form_post`). Verifies the ID token, mints Auth tokens, stashes them behind a single-use code, 303s to `<return_to>?heimdall_code=…`.

Path parameters

app_slug*string

Slug of the app.

provider*enum (3)

The sign-in provider: `google`, `github` or `apple`.

Request body

Response · 303

Redirect to `return_to`. Carries `?heimdall_code=<code>` on success and `?heimdall_error=<code>` on a handled failure. When the app runs `auth_config.mfa: "required"` and the account holds no enabled factor, NO session is minted and the redirect carries `?heimdall_code=<code>&heimdall_mfa_enrollment_required=1`; redeeming that code at `POST /{app_slug}/v1/auth/oauth/exchange` returns `{mfa_enrollment_required, mfa_token, expires_at}` instead of tokens, and the page must then complete `POST /{app_slug}/v1/auth/mfa/enroll` and `/auth/mfa/enroll/verify` with `mfa_token` to obtain tokens. No credential is ever put on the URL.

Example

Request

POST https://api.auth.productcraft.co/{app_slug}/v1/auth/oauth/{provider}/callback
Content-Type: application/json

{}