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

E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NEED_REMOTE_CONSENT. App: _packagename_, Service: oauth2:email https://mail.google.com/ openid profile

Open spiraldevapps opened this issue 3 years ago • 2 comments

Step 1: Are you in the right place?

This is a bug - everything was working fine and then since last 4 weeks we are facing this issue.

Step 2: Describe your environment

  • Device: ONEPLUS 6
  • OS version: ANDROID 10
  • SDK version: 29
  • [Android] Google Play Services version: 19.2.0

Step 3: Describe the problem:

Steps to reproduce:

  1. Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(gApiClient);
  2. startActivityForResult(signInIntent, REQUEST_ACCOUNT_PICKER);

Observed Results:

  • Login screen keeps on loading indefinitely after selecting the account

Expected Results:

  • onActivityResult should get called with signin data

Relevant Code:

 GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                          .requestIdToken(Constant.serverclientid) // required to get accesstoken
                          .requestScopes(new Scope(GmailScopes.MAIL_GOOGLE_COM))
                          .requestEmail()
                          .build();

                  GoogleApiClient gApiClient = new GoogleApiClient.Builder(getApplicationContext())
                          .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
                          .build();

                  ConnectionResult c = gApiClient.blockingConnect();

                  if (c.isSuccess() && gApiClient.isConnected()) {
                      Log.e(TAG,"connectionResult = success");
                      gApiClient.clearDefaultAccountAndReconnect().await();
                  }
                  else
                  {
                      Log.e(TAG,"connectionResult is failure");
                  }

                  GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(getApplicationContext(), gso);
                  mGoogleSignInClient.revokeAccess();

                //  Intent signInIntent = mGoogleSignInClient.getSignInIntent();

                  Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(gApiClient);

                  runOnUiThread(new Runnable() {
                      @Override
                      public void run() {

                          Log.d(TAG,"request account picker");

                          Aloading_spinner.setVisibility( View.GONE );
                          startActivityForResult(signInIntent, REQUEST_ACCOUNT_PICKER);


                      }
                  });

spiraldevapps avatar Sep 07 '21 18:09 spiraldevapps

Having same problem, do we have any solution?

glebkravchenko avatar Oct 26 '21 13:10 glebkravchenko

Also experiencing this issue. Does this happen due to requests cooldown during a series of consecutive closures? Maybe 2FA?

entrealist avatar Nov 21 '21 08:11 entrealist