/v1/auth/oauth/{provider}/callbackComplete a federated sign-in. auth-ui proxies the provider redirect (query params for Google/GitHub, form_post body for Apple) into this endpoint and uses the returned `tokens` to set the auth_token cookie.
Path parameters
provider*enum (3)The sign-in provider: `google`, `github` or `apple`.
Request body
state*stringOpaque state token returned by the IdP, minted at `/start`. Single-use; binds the callback to a specific browser session.
id_tokenstringJWT id_token from the IdP (OIDC providers; Apple form_post). Optional — either `idToken` or `code` must be supplied.
codestringOAuth authorization code returned by the IdP. Optional — either `idToken` or `code` must be supplied.
userstringApple-only first-signin payload: JSON-encoded `{ name, email }`. Apple returns this only the first time a user signs in. Not signed — treated as untrusted input by the controller's payload parser.
Response · 200
tokens*objectIssued PlatformUser session tokens. auth-ui sets the auth_token cookie from `accessToken` and 302s the browser to `return_to`.
return_to*stringOriginal `return_to` the user was sent off with. auth-ui redirects here after writing the cookie.
Example
Request
POST https://api.platform-auth.productcraft.co/v1/auth/oauth/{provider}/callback
Content-Type: application/json
{
"state": "string",
"id_token": "string",
"code": "string",
"user": "string"
}Response
{
"tokens": {},
"return_to": "string"
}