googlesamples / google-services

A collection of quickstart samples demonstrating the Google APIs for Android and iOS
https://developers.google.com
Apache License 2.0
3.05k stars 2.53k forks source link

When implementing Google Sign-In on Android, is it possible to indicate in the google account sign-in popup that only email address will be used? #615

Open jin-jobs opened 1 month ago

jin-jobs commented 1 month ago

Step 2: Describe your environment

Step 3: Describe the problem:

Steps to reproduce:

  1. Implement google sign in using CredentialManager and GetSignInWithGoogleOption.
  2. Build the app and press the google sign up button to proceed with the signup process.
  3. In the google account integration popup, you will see that “name, email address, profile picture” are accessible in the user's account.
image

Observed Results:

Desired Results:

Relevant Code:

            val credentialManager = CredentialManager.create(context)
            val request = GetCredentialRequest(
                listOf(
                    GetSignInWithGoogleOption.Builder($google_client_id)
                        .build()
                )
            )
            val result = credentialManager.getCredential(context, request)