Skip to content
MyAppBuilder
StableGuide

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

  1. In the Google Cloud Console, create an OAuth client ID of type Web application.
  2. Add the Authorized redirect URIs. Users → Sign-in → Google shows the exact values for your app; they look like:
Example
https://<your builder host>/api/runtime/<projectId>/auth/google-callback?channel=live
https://<your builder host>/api/runtime/<projectId>/auth/google-callback?channel=staging
  1. In MyAppBuilder open Settings → Environment & secrets. For Production (and Staging if you test there): - add GOOGLE_CLIENT_ID as a plain variable with the client id (123456789-abc.apps.googleusercontent.com); - add GOOGLE_CLIENT_SECRET as a secret with the client secret (GOCSPX-…). Secrets are stored encrypted and never shown again.
  2. Back in Users → Sign-in, turn on Google. The panel shows a check mark per environment when both values are present.
  3. Publish and open /login on the published app to try Continue with Google.

How it works for the visitor

  1. The visitor clicks Continue with Google on /login or on a Login Form component.
  2. Google asks them to choose an account and consent to sharing their email and profile. Only accounts with a verified Google email are accepted.
  3. 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."
  4. 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.

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.

Related

Was this helpful?