google-services icon indicating copy to clipboard operation
google-services copied to clipboard

OnActivityResult not called when using requestServerAuthCode

Open hendri-cermati opened this issue 6 years ago • 7 comments

Here is my device:

  • Device: Huawei Mate 10
  • OS version: 8.1.0
  • SDK version: 26/27
  • [Android] Google Play Services version: 14.3.66 (040408-213742215)

Steps to reproduce:

  1. use requestServerAuthCode when building GoogleSignInOptions
  2. Choose one of your Gmail Account
  3. After pressing allow, the dialog will show again to ask for permission and it will continue to loop.

Observed Results:

After pressing allow, onActivityResult was not called at all, but if I press deny It will call my onActivityResult with result CANCELLED

Expected Results:

  • What did you expect to happen?

Relevant Code:

GoogleSignInOptions gso = new GoogleSignInOptions
       .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
       .requestScopes(new Scope("https://www.googleapis.com/auth/gmail.readonly"))
       .requestServerAuthCode(serverClientId, true)
       .requestEmail()
       .build();
GoogleSignInClient client = GoogleSignIn.getClient(MainActivity.this, gso);
startActivityForResult(client.getSignInIntent(), SIGN_IN_INTENT_CODE);

hendri-cermati avatar Oct 05 '18 08:10 hendri-cermati

The same thing happened in my device when requesting offline access

  • Device: OPPO F1s
  • OS version: 5.1
  • SDK version: 22
  • [Android] Google Play Services version: 14.3.66 (040408-213742215)

ganjasmara avatar Oct 11 '18 12:10 ganjasmara

Cuu Hộ Giao Thông, cứu hộ oto

Cuuhootohanoisos avatar Nov 03 '18 07:11 Cuuhootohanoisos

Relevant Code:

GoogleSignInOptions gso = new GoogleSignInOptions .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestScopes(new Scope("https://www.googleapis.com/auth/gmail.readonly")) .requestServerAuthCode(serverClientId, true) .requestEmail() .build(); GoogleSignInClient client = GoogleSignIn.getClient(MainActivity.this, gso); startActivityForResult(client.getSignInIntent(), SIGN_IN_INTENT_CODE);

Cuuhootohanoisos avatar Nov 03 '18 07:11 Cuuhootohanoisos

Link account

PeChSovanRaBe avatar Nov 18 '18 15:11 PeChSovanRaBe

google-services/ios/signin/SignInExampleSwift/AppDelegate.swift

PeChSovanRaBe avatar Nov 18 '18 16:11 PeChSovanRaBe

https://www.googleapis.com/auth/gmail.readonly

PeChSovanRaBe avatar Nov 18 '18 16:11 PeChSovanRaBe

Is this issue still happening? Can anyone provide a working code example in a gist or repo that contains the looping behavior?

mwilc0x avatar May 05 '20 18:05 mwilc0x