The marketing CMS where agents draft and people publish
Menu

Set up Google and Microsoft sign-in

Let visitors sign up and log in on your site's public account pages with Continue with Google and Sign in with Microsoft, next to their email and password (and Continue with GitHub, if you offer it).

On a site Spillway hosting runs you may not need any of this: Site settings → Accounts offers Google (Spillway hosting) and Microsoft (Spillway hosting), which sign people in through Spillway's sign-in service with nothing to register. Turn them on and save. Follow the steps below only to use apps of your own, for example to show your site's name on Google's account chooser instead of Spillway's; your own provider then replaces the hosted one, and people who connected Microsoft keep their connection (Google's very likely too; anyone whose connection does not carry over signs in with their verified email or password and connects again). See Hosted sign-in.

Before you start: site accounts turned on (Site settings → Accounts), an admin account in Spillway (the users.manage permission), the site's public address known to the server (BASE_URL, or the site's own domain), since the callbacks are built from it, and access to a Google Cloud project and to the Microsoft Entra admin center. In the steps below, https://www.example.org stands for your site's address; use every address the site answers on.

Google

  1. Google Cloud console → Google Auth Platform. Under Branding, give the app your site's name, a support email and your domain as an authorized domain. Under Audience, choose External and Publish app, or only the test users you list can sign in.
  2. Data access: add the scopes openid, .../auth/userinfo.email and .../auth/userinfo.profile. They are not sensitive, so Google does not review them.
  3. Clients → Create client, type Web application. Under Authorized redirect URIs add https://www.example.org/account/google/callback. Copy the client id and the client secret.
  4. Spillway: Site settings → Sign-in → Add a provider → Google. The preset fills in the issuer https://accounts.google.com, the scopes openid email profile, prompt=select_account and Site accounts only. Paste the client id and secret, turn on Enabled and save. Test should report Google's discovery document and signing keys.
  5. Site settings → Accounts: turn on Offer Continue with Google and save.

Microsoft

  1. Microsoft Entra admin center → App registrations → New registration. Under Supported account types, choose who may sign in:
    • Accounts in any organizational directory and personal Microsoft accounts for a public site: any work, school or personal account (Spillway's Any work, school or personal Microsoft account, the common endpoint).
    • Accounts in any organizational directory for work and school accounts only (organizations), Personal Microsoft accounts only (consumers), or Accounts in this organizational directory only for one directory. Under Redirect URI, platform Web: https://www.example.org/account/microsoft/callback.
  2. Certificates & secrets → New client secret. Copy its Value (not its id) and note when it expires; put a new one in Spillway before then.
  3. Token configuration → Add optional claim, token type ID: tick email and xms_edov, and accept turning on the Microsoft Graph email permission. xms_edov says the email's domain is verified by the directory that issued it; without it Spillway never joins a Microsoft sign-in to an existing account by email (see the notes).
  4. API permissions: Microsoft Graph openid, email and profile (delegated). Nothing needs admin consent.
  5. Spillway: Site settings → Sign-in → Add a provider → Microsoft. Set Who can sign in to match step 1 (for one directory, put its tenant id, from the app's Overview, in the issuer URL). Paste the Application (client) ID and the secret, turn on Enabled and save. Test should report the discovery document and signing keys.
  6. Site settings → Accounts: turn on Offer Sign in with Microsoft and save.

Check the result

  • /account/login and /account/signup show Continue with Google and Sign in with Microsoft; /admin/login does not.
  • Signing in with a Google account whose address has no account here creates one (when visitors may create accounts) and lands on the account page; Connected sign-ins lists Google with that address.
  • Signing in with an account whose address already has an account here joins it; with two-step sign-in on, the code is asked next.
  • The audit log has account.signup and account.identity_link rows for the sign-ins.

Notes

  • Matching by email needs a verified address. A first sign-in joins an existing account only when Google reports email_verified or Microsoft sends xms_edov. Otherwise it is refused with a note: the person logs in with their email and password and uses Connect Google or Connect Microsoft on their account page. After that the provider signs them in by its own id for them, whatever their email there. Some Microsoft tokens may lack xms_edov even with the claim configured (personal accounts, for example); those people connect from the account page.
  • The callback must match exactly, including https and www; Google and Microsoft refuse any other.
  • Some organizations do not let their people approve apps themselves; they see a request for an administrator's approval. Verifying the app's publisher in Entra helps with that.
  • The Google and Microsoft providers never sign anyone in to the admin. Staff can use them on the account pages like anyone else.

Going further

Spillway 0.1.24

Was this page helpful?