ReferenceHTTP APIAuth

Finish Google sign-in; sets the session cookie

POST
/v1/auth/google/callback

Posts the code and state Google returned to the redirect URI. The first matching rule decides: an already linked Google account signs in as its user; an address that already has an account answers 409 LOGIN_LINK_REQUIRED and is never joined by email; otherwise a live invite for the address, or JIT for an allowed domain, creates the account. Anything else answers 401 without saying whether an account exists. A Google account outside the allowed domains answers 403.

Auth: public; no credential. Idempotency-Key: ignored.

Header Parameters

X-Requested-With*"werft-web"

Always required: the literal werft-web.

Value in"werft-web"

Request Body

application/json
  1. body
code*string
Length1 <= length <= 2048
state*string
Length1 <= length <= 256

Response Body

Success

application/json
  1. response
user_id*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
workspace_id*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
role*string
Value in"owner""admin""member"
scopes*array<>
expires_at*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
Example Request
curl -X POST 'https://example.com/v1/auth/google/callback' \  -H 'X-Requested-With: werft-web' \  -H 'Content-Type: application/json' \  -d '{  "code": "string",  "state": "string"}'
Example Response
{  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",  "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",  "role": "owner",  "scopes": [    "sessions:read"  ],  "expires_at": "2019-08-24T14:15:22Z"}