Social login providers

Enable Google, Apple, GitHub, and 19+ sign-in providers, configure Preview and custom-domain redirect URLs, and prevent duplicate-account surprises.

How OAuth social sign-in works

Social login removes password fatigue. Instead of your app storing a password, a trusted identity provider — such as Google, Apple, or GitHub — confirms the visitor's identity and sends your server a verified sign-in proof.

Every OAuth login runs four quick steps:

  • Redirect to provider. Clicking Continue with Google (or Apple or GitHub) sends the visitor to the provider with your Client ID and redirect URL.
  • User approves consent. The visitor signs in and approves sharing basic profile fields (name, avatar, verified email).
  • Callback with one-time code. The provider redirects back strictly to your allowlisted redirect (callback) URL with a short-lived code.
  • Server exchanges code for a session. Your backend exchanges that code using your private Client Secret on the server, loads or creates the user row, and sets an HTTP-only session cookie.

Because code exchange happens strictly on the server, your Client Secret never reaches browser code.

Picking providers from 19+ supported options

ExaSpark supports 19+ sign-in providers across consumer, developer, and corporate audiences. Offering two or three familiar choices converts better than a wall of eight buttons and keeps returning customers from accidentally creating duplicate accounts.

ProviderBest audienceWhy users prefer itKey detail to plan for
GoogleConsumer apps, local services, Google Workspace teamsOne-tap login across Chrome, Android, and desktopPublish your OAuth consent screen to In production before launch
AppleiPhone Safari visitors, consumer appsNative Face ID / Touch ID sign-inSupports Hide My Email relays; sends name only on first sign-in
GitHubDeveloper tools, technical SaaSInstant single-click engineering identityRequest user:email scope so private GitHub emails still resolve
Microsoft / Entra IDCorporate teams and B2B portalsMatches work laptops and Microsoft 365 policiesIdeal for internal tools restricted to a verified company domain
Email + Magic LinkUniversal fallback for every appWorks without any third-party social accountPair with branded domain sending on launch

Configuring redirect URLs for Preview and Live

Most OAuth errors come from one setting: authorized redirect (callback) URLs. Providers reject any login whose callback URL does not match their allowlist character for character — including https://, subdomain, and trailing slashes.

Because ExaSpark keeps Preview and Live isolated, register every active origin you use:

text
ENVIRONMENT          ORIGIN EXAMPLE                    WHEN TO REGISTER
------------------------------------------------------------------------------------
Preview workspace    https://<preview-host>/...        During build & QA
Default Live URL     https://<your-app>.exaspark.app   On initial Publish
Custom Live domain   https://app.yourdomain.com        When connecting a domain

PROVIDER CONSOLE CHECKLIST
  1. Authorized origins:    add every active https:// origin above
  2. Redirect URIs:         paste the exact callback URL from Cloud -> Auth
  3. Policy links:          point to live /privacy and /terms pages
  4. Consent status:        switch from "Testing" to "In production"

When you connect a custom domain on Starter or Pro, add its callback URL in your Google, Apple, or GitHub console right after DNS verifies so social login works seamlessly on the new domain. See Custom domains & DNS.

Step-by-step: enabling Google, Apple, or GitHub login

Follow these five steps in order so both Preview testing and your Live launch work on the first click.

  1. Enable your providers in Cloud → Auth

    Open the Cloud tab, select the providers you want (for example, Google and Email), and copy the exact callback URLs listed for Preview and Live.

  2. Create OAuth credentials in the provider console

    In Google Cloud Console, Apple Developer, or GitHub Developer Settings, create an OAuth application and paste your exact Preview and Live redirect URLs into the allowlist.

  3. Save Client ID and Client Secret safely

    Enter each provider's Client ID and Client Secret into ExaSpark's provider settings (kept strictly server-side, never pasted into frontend code or public prompts).

  4. Publish the provider consent screen

    In Google Cloud, add your app logo, support email, /privacy link, and /terms link, then move the OAuth consent screen out of Testing mode so real visitors are not blocked.

  5. Test full login loops in Preview and Live

    Sign in with a fresh test account, confirm your profile name and avatar save cleanly, sign out, and sign back in to confirm returning users land in the exact same account.

Avoiding account-linking and duplicate-account surprises

Customers rarely remember whether they first signed up with email or Continue with Google. Thoughtful account-linking rules prevent both accidental duplicate accounts and account-takeover bugs.

If someone registered jamie@studio.com with a password and later clicks Continue with Google using that address, merge them strictly when both sides verify the email. Never auto-link to an unverified password account — otherwise an attacker could pre-register a victim's email before they ever visit your app.

Plan for Apple Hide My Email and first-login names

Two Apple Sign-In details surprise builders who skip testing on iPhone:

  • Apple sends `full_name` only once. Save full_name on the user's first sign-in and never overwrite it with null on return visits.
  • Hide My Email creates a relay address (abc123@privaterelay.appleid.com). Because that relay will not match an existing Gmail account automatically, provide a Connected sign-in methods panel inside Account Settings so signed-in users can view and link providers.

Protect the user's last sign-in method

Block users from unlinking their final remaining sign-in provider unless they have verified an email password or connected a second provider.

Starter prompt · App

Add Google, Apple, and email magic-link sign-in on `/login` and `/signup`. Store the user's name and avatar from the provider on first sign-in without overwriting customized profile fields on later logins. Auto-link social logins to an existing account only when the email is verified on both sides, preserve `?next=` return URLs across the OAuth redirect, and add a "Connected sign-in methods" section in `/settings/account` that displays linked providers and prevents unlinking the user's last sign-in method.

Troubleshooting OAuth sign-in errors

When a social login button bounces back with an error page, the provider message usually pinpoints the exact configuration mismatch.

Error or symptomMost likely causeHow to fix it
`Error 400: redirect_uri_mismatch`Active domain (Preview, .exaspark.app, or custom domain) is missing from the provider's allowed redirect URIsCopy the exact callback URL from Cloud → Auth and add it to your provider console without extra trailing slashes
Google says "Access blocked: app has not completed verification" or caps at 100 usersGoogle OAuth consent screen is still in Testing mode, or requested sensitive scopes beyond basic profile/emailRequest only openid, email, and profile scopes, then publish the consent screen to In production
Apple Sign-In user has blank name after second visitApp tried to read full_name on every login instead of saving it on first creationPersist full_name on first sign-in and prompt gracefully in onboarding if a user skipped sharing their name
GitHub login fails with "Email required"Developer set their GitHub email to private and app did not fetch verified primary emailsRequest the user:email scope and select the user's primary verified email from GitHub's email endpoint
Returning customer lands in a brand-new empty accountUser signed up with Google earlier, then clicked Apple (Hide My Email) or a different work emailShow "Last signed in with..." hints where appropriate and let signed-in users link providers in Account Settings
Login succeeds, then immediately drops back to `/login`Session cookie mismatch across http/https or custom domain redirect bounceVerify your Live app redirects cleanly to one canonical https:// origin; see Debugging auth & CORS

Next steps

Still have a question?Ask our team and other builders on Discord.

From the blog