Google sign-in
With Google sign-in, people click Continue with Google and use their Google account instead of a password. Your app needs its own Google OAuth client; MyAppBuilder stores its id as a plain variable and its secret as an encrypted secret.
Google sign-in
With Google sign-in, people click Continue with Google and use their Google account instead of a password. Your app needs its own Google OAuth client; MyAppBuilder stores its id as a plain variable and its secret as an encrypted secret.
When to use
- Customers who prefer not to create another password.
- Teams already on Google Workspace.
It can be combined with Email & password and Magic link; the sign-in screen shows every enabled method.
How to set it up
- In the Google Cloud Console, create an OAuth client ID of type Web application.
- Add the Authorized redirect URIs. Users → Sign-in → Google shows the exact values for your app; they look like:
https://<your builder host>/api/runtime/<projectId>/auth/google-callback?channel=live https://<your builder host>/api/runtime/<projectId>/auth/google-callback?channel=staging
- In MyAppBuilder open Settings → Environment & secrets. For Production (and Staging if you test there): - add
GOOGLE_CLIENT_IDas a plain variable with the client id (123456789-abc.apps.googleusercontent.com); - addGOOGLE_CLIENT_SECRETas a secret with the client secret (GOCSPX-…). Secrets are stored encrypted and never shown again. - Back in Users → Sign-in, turn on Google. The panel shows a check mark per environment when both values are present.
- Publish and open
/loginon the published app to try Continue with Google.
How it works for the visitor
- The visitor clicks Continue with Google on
/loginor on a Login Form component. - Google asks them to choose an account and consent to sharing their email and profile. Only accounts with a verified Google email are accepted.
- Back in your app: - if an account with that email exists, the visitor is signed in and the Google account is linked to it; - if none exists and Allow sign-up is on, an account is created with the Role for new sign-ups and marked verified; - if none exists and sign-up is off, they see "Sign-up is not available for this app."
- The visitor lands on the page they came from.
Common mistakes
- Redirect URI mismatch. Google refuses with an error if the URI in the console differs even slightly (http vs https, channel parameter). Copy it from the Sign-in tab.
- Values set for the wrong environment. The staging app uses Staging variables, the live app uses Production. Missing values make the attempt fail with "Google sign-in is not configured for this app."
- Putting the client secret in a plain variable. It must be a secret; plain variables are not encrypted.
- Expecting Google sign-in in the builder preview. The button is not shown in the draft preview; use the staging or live app.
- Builder vs app Google sign-in. The platform's own
GOOGLE_CLIENT_ID(for builder accounts) is separate from your app's values.
Related
Advanced
GET /api/runtime/:projectId/auth/google?channel= redirects to Google with scope openid email profile and a random state kept in a short-lived httpOnly cookie; …/auth/google-callback verifies the state, exchanges the code server-side and creates the app session. The client id may also be stored as a secret; the secret always must be.