Skip to content

chore: Switch Google web sign-in to the redirect flow#497

Draft
Zfinix wants to merge 3 commits into
mainfrom
docs/google-web-redirect-flow
Draft

chore: Switch Google web sign-in to the redirect flow#497
Zfinix wants to merge 3 commits into
mainfrom
docs/google-web-redirect-flow

Conversation

@Zfinix
Copy link
Copy Markdown
Contributor

@Zfinix Zfinix commented May 13, 2026

Summary

  • Switches the documented Google web sign-in flow to the OAuth2 redirect path (flutter_web_auth_2 + auth.html). The popup/iframe flow is no longer the default in the docs.
  • Adds a shared Web callback page (auth.html) section under concepts/authentication/setup so GitHub, Google, and any future redirect-based IdP reference one canonical place.
  • Rewrites the Google Web subsection, OAuth client URI table, passwords.yaml examples (dev + prod), initializeGoogleSignIn example (clientId + redirectUri under kIsWeb), and the Publishing-to-production redirect URI to use /app/auth.html (the standard template path).
  • Updates the Google troubleshooting page for redirect-mode failure modes (callback never returns, clientId is required, redirect_uri_mismatch across all three configuration spots) and drops popup-only entries.
  • Updates GitHub setup to reference the shared auth.html section instead of inlining the snippet.
  • Adds a "Configuring the Web redirect URI" subsection to Google customizations covering the --dart-define pattern.

Supersedes #494. Most of the redirect-flow content originated from @vfiruz97's work there; this PR re-applies that intent on top of the recently merged #490.

Requires serverpod_auth_idp_flutter >= 3.5.0-beta.7 (the version that adds the redirectUri parameter to initializeGoogleSignIn).

@Zfinix Zfinix changed the title docs: refactor docs for google web redirect flow docs: Switch Google web sign-in to the redirect flow May 13, 2026
@Zfinix Zfinix changed the title docs: Switch Google web sign-in to the redirect flow chore: Switch Google web sign-in to the redirect flow May 13, 2026
@Zfinix Zfinix requested review from Swiftaxe and vfiruz97 and removed request for Swiftaxe May 14, 2026 07:06
Copy link
Copy Markdown
Contributor

@vfiruz97 vfiruz97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


3. **Add the client ID to your Flutter project's `web/index.html`** (e.g., `my_project_flutter/web/index.html`). In the `<head>` section, add:
:::note
On the standard Serverpod project template, the Flutter web build is copied into the Serverpod web server's `web/app/` folder when you run the `flutter_build` script. If you deploy that way, the production callback lives at `https://your-domain.com/app/auth.html`, not at the domain root. Register that exact URL in **Authorized redirect URIs**.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be nice, if you mentioned serverpod run flutter_build.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do great.

@Zfinix Zfinix self-assigned this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants