Start signing in with Google
auth.google.start
GET/api/v1/auth/google
- Route
- Public
Browser navigation only. Redirects to Google's account chooser. After Google returns to the callback, the browser lands on return_to signed in, or with a sign_in_error query parameter.
Parameters#
| Field | Description |
|---|---|
return_toquerystringoptional | App path to open after signing in, such as /family. Other origins and API paths are ignored. |
Response#
302 Redirect to Google, or back to the app with sign_in_error=not_configured. No body.
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|
Examples#
These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.
Start signing in with Google
A browser navigation. The API sets short-lived cookies for the flow and redirects to Google's account chooser.
curl 'https://rigel.house/api/v1/auth/google?return_to=/family'const response = await fetch("https://rigel.house/api/v1/auth/google?return_to=/family");
const data = await response.json();GET /api/v1/auth/google?return_to=/family HTTP/1.1
Host: rigel.houseHTTP/1.1 302 Found
X-Request-Id: req_01M6V9CS64NT785TDE9SWM3PZE
Location: https://accounts.google.com/auth?state=CSDHpd7jP6BjirNhghiJr65Qi4zXC6H9zffQh0fJ8Ko&redirect_uri=https%3A%2F%2Frigel.house%2Fapi%2Fv1%2Fauth%2Fgoogle%2Fcallback