Skip to content

Hosted Domain Not Working Properly On Google Sign In 7.1.1 #174200

Closed
flutter/packages
#9871

Description

@luqmanulhakiem

Steps to reproduce

  1. initialize GoogleSignIn using hostedDomain
  2. run authenticate with scopes
  3. see list email displaying on google sign in pop up

Expected results

list email with domain that already registered on hostedDomain when initializing GoogleSignIn

Actual results

displaying all email in outside of registered domain.
example:

  • i registered mycustomdomain.com , but google sign in pop up shows all my email including gmail.com

Code sample

My Code
final GoogleSignIn gsi = GoogleSignIn.instance;
  final List<String> gsiScopes = [
    "profile",
    "email",
  ];

  await gsi.initialize(
    hostedDomain: "customdomain.com",
    serverClientId: "MY_SERVER_CLIENT_ID",
    clientId: "MY_CLIENT_ID",
  );
 
GoogleSignInAccount? googleUser;

googleUser = await gsi.authenticate(scopeHint: scopes);

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.8, on macOS 14.5 23F79 darwin-arm64, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 16.1)
    ! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.103.1)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for iPhone Luqmanul Hakiem. Ensure the device is unlocked and attached with a cable
      or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

! Doctor found issues in 1 category.

Activity

  1. stuartmorgan-g commented on Aug 21, 2025

    @stuartmorgan-g
    Contributor

    What platform(s) are you seeing this on?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    in triagePresently being triaged by the triage team
    on Aug 21, 2025
  3. added
    platform-androidAndroid applications specifically
    packageflutter/packages repository. See also p: labels.
    P1High-priority issues at the top of the work list
    fyi-androidFor the attention of Android platform team
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    in triagePresently being triaged by the triage team
    on Aug 21, 2025
  4. stuartmorgan-g commented on Aug 21, 2025

    @stuartmorgan-g
    Contributor

    It looks like I missed wiring this up on Android. Oddly, only one of the two Android flows seems to have a way to specify hosted domain, so I'll need to investigate how to handle that. I may need to restrict one-tap to previous sign-ins if there's a hosted domain set.

    Please let me know if you are seeing issues with hosted domains on any platforms other than Android.

  5. github-actions commented on Sep 12, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listfyi-androidFor the attention of Android platform teamp: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions