[PR #5882] feat: add support for multiple Google client IDs for cross-platform authentication #14540

Closed
opened 2026-04-13 09:31:27 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5882

State: closed
Merged: No


This is an updated fork of: https://github.com/RikhiSingh/better-auth/tree/feat/google-multiple-client-ids branch

Related issue: https://github.com/better-auth/better-auth/issues/4498
And previously closed PR: https://github.com/better-auth/better-auth/pull/4583

Until this gets merged: https://github.com/better-auth/better-auth/issues/4498#issuecomment-3659493448


Summary by cubic

Adds multi-client ID support to the Google provider so cross-platform apps (iOS, Android, Web) can authenticate reliably. Uses the first ID for OAuth flows and validates ID tokens against all configured IDs.

  • New Features

    • Google provider accepts clientId as a string or an array.
    • First client ID is used for auth URL, code exchange, and token refresh; ID token verification checks all IDs.
    • Docs updated with setup examples; tests added for multi-ID verification and flows.
  • Refactors

    • ProviderOptions clientId is now a required string; GoogleOptions overrides to allow string | string[].
    • Added error for empty clientId arrays and accepted issuer "accounts.google.com" (without https).
    • TikTok options now omit clientId; minor test/type cleanups.

Written for commit b9cff49095. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5882 **State:** closed **Merged:** No --- This is an updated fork of: https://github.com/RikhiSingh/better-auth/tree/feat/google-multiple-client-ids branch Related issue: https://github.com/better-auth/better-auth/issues/4498 And previously closed PR: https://github.com/better-auth/better-auth/pull/4583 Until this gets merged: https://github.com/better-auth/better-auth/issues/4498#issuecomment-3659493448 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds multi-client ID support to the Google provider so cross-platform apps (iOS, Android, Web) can authenticate reliably. Uses the first ID for OAuth flows and validates ID tokens against all configured IDs. - **New Features** - Google provider accepts clientId as a string or an array. - First client ID is used for auth URL, code exchange, and token refresh; ID token verification checks all IDs. - Docs updated with setup examples; tests added for multi-ID verification and flows. - **Refactors** - ProviderOptions clientId is now a required string; GoogleOptions overrides to allow string | string[]. - Added error for empty clientId arrays and accepted issuer "accounts.google.com" (without https). - TikTok options now omit clientId; minor test/type cleanups. <sup>Written for commit b9cff490957c91f05e25fc88faf2aec32d048409. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:31:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14540