Skip to content

docs: Enhance GitHub Sign-In setup, customizations, and troubleshooting#521

Open
Zfinix wants to merge 7 commits into
mainfrom
chore/update-sign-in-with-github-docs
Open

docs: Enhance GitHub Sign-In setup, customizations, and troubleshooting#521
Zfinix wants to merge 7 commits into
mainfrom
chore/update-sign-in-with-github-docs

Conversation

@Zfinix
Copy link
Copy Markdown
Contributor

@Zfinix Zfinix commented May 18, 2026

Problem

The Sign in with GitHub docs lagged behind Google and Apple in structure and depth: no Prerequisites section, title-case headings inconsistent with sibling providers, no production deployment guidance, no troubleshooting page, stale screenshots, and a thin customizations page missing the server-side API hook, global auth user hooks, and parameter reference. The Web flow also predated the new FlutterWebAuth2CallbackRoute and relied on a manually-created auth.html even when Serverpod could serve the callback itself.

Solution

  • Setup page -- Added Prerequisites, sentence-case headings, and a ## Publishing to production section with self-hosted and Serverpod Cloud (scloud password set) paths. Web flow refactored into Serverpod-hosted (using pod.configureFlutterWebAuth2CallbackRoute() and /auth/callback) and separately-hosted (static auth.html) sub-paths. Five new screenshots replace the stale set.
  • Customizations page -- Renamed from 02-configuration.md to 02-customizations.md for parity with Google. Added GitHubIdpConfig vs GitHubIdpConfigFromPasswords intro, manual credential loading, server-side API access via getExtraGitHubInfoCallback, global onBeforeAuthUserCreated / onAfterAuthUserCreated hooks, and a parameter reference table.
  • Troubleshooting page (new) -- Setup checklist and 11 scenarios covering redirect_uri_mismatch, callback handling for both web flows, email null, dev-vs-prod failures, installation scope, org OAuth restrictions, bad_verification_code, rate limits, permission re-authorization, and migration issues.

Requires serverpod_auth_idp_server 3.5.0-beta.8 or later for configureFlutterWebAuth2CallbackRoute. Depends on serverpod/serverpod#5133.

@Zfinix Zfinix self-assigned this May 18, 2026
@Zfinix Zfinix requested a review from Swiftaxe May 22, 2026 06:53
@Zfinix Zfinix marked this pull request as ready for review May 22, 2026 06:53
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
Comment thread docs/06-concepts/11-authentication/04-providers/07-github/01-setup.md Outdated
@Zfinix Zfinix requested a review from Swiftaxe June 2, 2026 07:56
Serverpod can host this callback for you when the Flutter web app is served by the same Serverpod server (the default project template, which copies the Flutter web build into Serverpod's `web/app/` directory via the `flutter_build` script). Use the static `auth.html` fallback only if your Flutter web app is hosted on a different origin (for example, a separate dev server during local development, or a CDN in production).
```bash
flutter build web --output ../my_project_server/web/app # from your Flutter project
dart run bin/main.dart # from your server project
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this the recommended workflow for this even though we have the new serverpod start workflow?

2. Add the full callback URL to your GitHub App's **Callback URL** field (e.g., `http://localhost:8082/auth/callback` locally, `https://my-awesome-project.serverpod.space/auth/callback` in production). GitHub Apps accept up to 10 entries, so dev and prod entries can coexist.

2. Register `https://my-awesome-project.serverpod.space/auth/callback` as a **Callback URL** on your GitHub App.
3. Pass the same URL to `initializeGitHubSignIn` via the `redirectUri` argument when you initialize the client (covered in [Initialize the GitHub sign-in service](#initialize-the-github-sign-in-service) below).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Having a step here mentioning something below gets confusing. Instead, refer back to the callback URL in step 2, from the section below, and remove this step 3. It adds noise and confusion.


:::note
`FlutterWebAuth2CallbackRoute` requires `serverpod_auth_idp_server` 3.5.0-beta.8 or later. On earlier versions, use the [Separately-hosted Flutter web](#separately-hosted-flutter-web-or-local-flutter-dev-server) flow instead.
`FlutterWebAuth2CallbackRoute` requires `serverpod_auth_idp_server` 3.5.0-beta.8 or later.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requirements shall be put at the top before starting, just as in the other guides.

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