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 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.
- Data access: add the scopes
openid,.../auth/userinfo.emailand.../auth/userinfo.profile. They are not sensitive, so Google does not review them. - 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. - Spillway: Site settings → Sign-in → Add a provider → Google. The preset fills in the issuer
https://accounts.google.com, the scopesopenid email profile,prompt=select_accountand Site accounts only. Paste the client id and secret, turn on Enabled and save. Test should report Google's discovery document and signing keys. - Site settings → Accounts: turn on Offer Continue with Google and save.
Microsoft
- 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
commonendpoint). - 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.
- 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
- Certificates & secrets → New client secret. Copy its Value (not its id) and note when it expires; put a new one in Spillway before then.
- Token configuration → Add optional claim, token type ID: tick
emailandxms_edov, and accept turning on the Microsoft Graphemailpermission.xms_edovsays 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). - API permissions: Microsoft Graph
openid,emailandprofile(delegated). Nothing needs admin consent. - 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.
- Site settings → Accounts: turn on Offer Sign in with Microsoft and save.
Check the result
/account/loginand/account/signupshow Continue with Google and Sign in with Microsoft;/admin/logindoes 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.signupandaccount.identity_linkrows 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_verifiedor Microsoft sendsxms_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 lackxms_edoveven with the claim configured (personal accounts, for example); those people connect from the account page. - The callback must match exactly, including
httpsandwww; 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
- Enterprise sign-in (SSO) for the presets and staff sign-in.
- Security: connected sign-ins for how identities are linked and checked.
- API: site accounts for the routes.
Spillway 0.1.24