Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't login to Google account #151

Closed
exstrim401 opened this issue Sep 7, 2021 · 40 comments
Closed

Can't login to Google account #151

exstrim401 opened this issue Sep 7, 2021 · 40 comments
Labels
bug Something isn't working

Comments

@exstrim401
Copy link

I use two factor auth. Created app password at https://myaccount.google.com/apppasswords but apkeep says that it's incorrect. Same with my real password

@L34T
Copy link

L34T commented Sep 7, 2021

Same without 2-factor.

@Hainish
Copy link
Member

Hainish commented Sep 7, 2021

Strange, I just tested it and it works for me. Did you ensure to escape the password properly?

@Hainish
Copy link
Member

Hainish commented Sep 7, 2021

For the record, I'm using an app password.

@Hainish
Copy link
Member

Hainish commented Sep 7, 2021

Also, did you enter your full email address as the username?

@ryanerwin
Copy link

I tried on an account without 2 factor auth, and the Google Login still doesn't work for me.

Could not log in to Google Play.  Please check your credentials and try again later.

apkpure version works fine

./apkeep -a com.instagram.android .
Downloading com.instagram.android...

google play version fails

./apkeep -d GooglePlay --username account@domain.com --password SuperSecretSauce  -a com.instagram.android .
Could not log in to Google Play.  Please check your credentials and try again later.

@Hainish
Copy link
Member

Hainish commented Sep 8, 2021

@ryanerwin for accounts with 2FA you need to create an app password in account settings. Did you try with that?

@ryanerwin
Copy link

This test was on an account WITHOUT 2 factor auth

@Hainish
Copy link
Member

Hainish commented Sep 8, 2021

Ah, sorry, misread that. Alright, I'm pressed for time this week so I'll have to check what's going on next week with this.

@ryanerwin
Copy link

No worries.

If you need any additional debug / reproduce information to get to the bottom of it, please let me know.

@Hainish Hainish added the bug Something isn't working label Sep 8, 2021
@L34T
Copy link

L34T commented Sep 8, 2021

Tried both username and with full email of two different accounts w/o 2-factor.
Ps and it will be great if our passwords would not be saved in system logs(bash history at least).

@Hainish
Copy link
Member

Hainish commented Sep 14, 2021

@ryanerwin I just removed 2FA on my test account and generated a new 25 character password which includes A-Z, a-z, 0-9 and special characters. I was unable to reproduce the bug. Can you try to see if the download works when you:

  1. Generate a new password with the format above (I used keypassxc for the password generation, but different software may include a different set of what it considers "special characters")
  2. Create a new google account with the same password as your current account

@Hainish
Copy link
Member

Hainish commented Sep 14, 2021

Alright, I'm able to reproduce this on a new account I created. I was wondering if this was because I had never linked an Android device to that account, and thus never went through any Play Store TOS agreement dialogue. This doesn't seem to be the case, though, since I just added a device to the new account and I'm still getting that invalid credentials error. I'll have to inspect the traffic and see if there's a deeper error that isn't propagating up to the user.

@Hainish
Copy link
Member

Hainish commented Sep 14, 2021

Inspecting the traffic, I'm seeing the following (token redacted):

Error=NeedsBrowser
Url=https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?hl%3Den_US_en%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ErrorDetail=To access your account, you must sign in on the web. Touch Next to start browser sign-in.

Looking this up on Google led me to this page: nviennot/android-checkin#3

Looks like

Just tried this, still getting the same error though. Might need to propagate, I'll give it a little time before trying something different.

@Hainish
Copy link
Member

Hainish commented Sep 14, 2021

This might be an issue where Google is forcing people through a login prompt that requires you to enter your phone number before proceeding. I'm going to work on propagating the error up through https://github.com/Hainish/rs-google-play/tree/master/gpapi to the user.

@ryanerwin
Copy link

I've enabled "less secure apps" in the account I was testing with, however even that isn't enough...

Still getting:

Could not log in to Google Play.  Please check your credentials and try again later.

@Hainish
Copy link
Member

Hainish commented Sep 15, 2021

@ryanerwin have you also done this: https://accounts.google.com/b/0/DisplayUnlockCaptcha

@Hainish
Copy link
Member

Hainish commented Sep 15, 2021

For reference, here is how the Python library handles this error: https://github.com/NoMore201/googleplay-api/blob/664c399f8196e1eb7d2fcda4af34e5dc1fca0f20/gpapi/googleplay.py#L234

I usually follow their conventions. I'm going to add this and have it propagate up to the user. I'm unsure how else to deal with this, it seems like a problem on Google's side.

@Hainish
Copy link
Member

Hainish commented Sep 15, 2021

@exstrim401 @L34T @ryanerwin

When running from the latest master commit, are you now seeing the following error message?

Security check is needed, try to visit https://accounts.google.com/b/0/DisplayUnlockCaptcha to unlock, or setup an app-specific password

@L34T
Copy link

L34T commented Sep 20, 2021

When running from the latest master commit, are you now seeing the following error message?

Security check is needed, try to visit https://accounts.google.com/b/0/DisplayUnlockCaptcha to unlock, or setup an app-specific password

tag 0.5.0-16-g5a360ed

  1. requires 'libssl-dev' package to build
  2. Got the message, account access switched. Nothing changed.
  3. Tryed debugging proxy but with env http/https_proxy have no success. Maybe you could suggest best way to use custom proxy for debugging apkeep?

@vadimszzz
Copy link

vadimszzz commented Nov 11, 2021

@Hainish

apkeep -a com.instagram.android . -d GooglePlay -u 'kimjongun@example.com' -p *********
Could not log in to Google Play.  Please check your credentials and try again later.

Still Error=NeedsBrowser

Both clicking https://www.google.com/settings/security/lesssecureapps and https://accounts.google.com/b/0/DisplayUnlockCaptcha didn't help.

@vadimszzz
Copy link

vadimszzz commented Nov 11, 2021

@Hainish
Copy link
Member

Hainish commented Nov 15, 2021

0a84406 updates dependencies to implement the solution in #151. I was unable to reproduce the problem, so someone else will have to test it the current master fixes the problem.

@Hainish
Copy link
Member

Hainish commented Jan 12, 2022

Until I get an account that can effectively debug this, it's hard for me to track the issue down.

When I turn off 2FA, I can download apps with my password.

When 2FA is enabled, I can create an app password and that works just as well.

@raffaem
Copy link

raffaem commented Jan 20, 2022

Same thing happens to me, I have an account with 2FA and I set up a app password:

$ ./apkeep-x86_64-unknown-linux-gnu -d GooglePlay --username myemail@gmail.com --password apppassword -a com.a2a.energia .

@raffaem
Copy link

raffaem commented Jan 20, 2022

0a84406 updates dependencies to implement the solution in #151 (comment). I was unable to reproduce the problem, so someone else will have to test it the current master fixes the problem.

It doesn't.

I have tried to install the latest commit with: cargo install --git https://github.com/EFForg/apkeep.git

And I still get the error:

$ apkeep -d google-play --username myemail@gmail.com --password myapppassword -a com.a2a.energia .
Could not log in to Google Play.  Please check your credentials and try again later.

The account has 2FA and I'm using an app password.

Until I get an account that can effectively debug this, it's hard for me to track the issue down.

Didn't you say that you were able to reproduce this with a new account?

Alright, I'm able to reproduce this on a new account I created.

@exstrim401
Copy link
Author

0a84406 updates dependencies to implement the solution in #151 (comment). I was unable to reproduce the problem, so someone else will have to test it the current master fixes the problem.

It doesn't.

I have tried to install the latest commit with: cargo install --git https://github.com/EFForg/apkeep.git

And I still get the error:

$ apkeep -d google-play --username myemail@gmail.com --password myapppassword -a com.a2a.energia .
Could not log in to Google Play.  Please check your credentials and try again later.

The account has 2FA and I'm using an app password.

Until I get an account that can effectively debug this, it's hard for me to track the issue down.

Didn't you say that you were able to reproduce this with a new account?

Alright, I'm able to reproduce this on a new account I created.

same here

@zoracon
Copy link

zoracon commented Feb 15, 2022

version: 0.8.0

Access type: 2FA


Was able to reproduce with a specific condition. I am running a Wireguard server, a UDP based VPN protocol. When turned on and pointing to 1.1.1.1/1.0.0.1 I can't even call www.googleapis.com.

ping: www.googleapis.com: Temporary failure in name resolution

On APKeep:
Could not log in to Google Play. Please check your credentials and try again later.

When turned off, I am able to call and download a test .apk package without issue.

I wasn't able to grab all info I needed as to which particular failure during resolution occurred (my internet is flaky at the moment), but that was the main block on my end as to why I could not login.

It's not a resolution because that insinuates DNS problems for everyone on this issue, but maybe try pinging www.googleapis.com and see what shakes (or doesn't shake).

@skjom84
Copy link

skjom84 commented Jul 24, 2022

Tried both app password and own account password but getting same login error for Google play
ApkPure download works fine.

I don't have a device associated with my google account Incase that makes a difference.

@Hainish
Copy link
Member

Hainish commented Nov 9, 2022

As a note, Google has disallowed "less secure apps" in May. I don't currently have an account where I'm encountering these issues.

@EFForg EFForg deleted a comment Nov 16, 2022
@EFForg EFForg deleted a comment Nov 16, 2022
@Hainish
Copy link
Member

Hainish commented Nov 16, 2022

@skjom84 You may need to accept the Google Play Terms of Service in order to download apps with apkeep. Can you try that in your browser first? If that doesn't work, an emulator might be needed.

@Hainish Hainish transferred this issue from EFForg/apkeep Nov 17, 2022
@Hainish Hainish transferred this issue from EFForg/rs-google-play Nov 17, 2022
@cohosh
Copy link

cohosh commented Nov 19, 2022

Hi, I'm having the same problem. I modified the code a bit to print out the error:

diff --git a/src/google_play.rs b/src/google_play.rs
index b166007..b7f6d47 100644
--- a/src/google_play.rs
+++ b/src/google_play.rs
@@ -32,7 +32,7 @@ pub async fn download_apps(
     if let Err(err) = gpa.login(username, password).await {
         match err.kind() {
             GpapiErrorKind::SecurityCheck | GpapiErrorKind::EncryptLogin => println!("{}", err),
-            _ => println!("Could not log in to Google Play.  Please check your credentials and try again later."),
+            _ => println!("Could not log in to Google Play.  Please check your credentials and try again later. {}", err),
         }
         std::process::exit(1);
     }

And I got

Could not log in to Google Play.  Please check your credentials and try again later. No GSF auth token

I saw there was a similar issue opened in the gapi project, but no details on how it was solved: EFForg/rs-google-play#1

I think GSF stands for Google Services Framework, maybe we need a validated device registered to the google play account?

@Ivan-Markovic
Copy link

I have the same issue "Could not log in to Google Play. Please check your credentials and try again later. ".
I tried with normal/app password with/without 2FA, logging to the browser from desktop/mobile.

@ghost
Copy link

ghost commented Sep 3, 2023

note that the EncryptedPasswd login method coded here:

https://github.com/EFForg/rs-google-play/blob/2f15b2b1/gpapi/src/lib.rs#L985-L1000

has not been used by Google Services Framework since version 4.4 (2013). since version 5 (2014), the login uses this URL:

https://accounts.google.com/embedded/setup/android

and since version 7.1 (2016), this URL is used:

https://accounts.google.com/embedded/setup/v2/android

a password login is still possible, but its protected with Google bot-guard, so probably a better option is to accept the oauth_token cookie instead.

@nutterthanos
Copy link

@exstrim401 @Hainish ^

@codeurimpulsif
Copy link
Contributor

Same here after building the last released of Apkeep (0.15.0) and the last commit (74c63f8):

$ target/debug/apkeep --app com.instagram.android -d google-play -u '[redacted]' -p '[redacted]' ./
Could not log in to Google Play.  Please check your credentials and try again later. No GSF auth token

More strange: all works as expected with the binary asset in the last release from Github, but it fail if I compile it myself.

Do you build it with special flags or options?

@3052
Copy link

3052 commented Jan 8, 2024

@codeurimpulsif as previously mentioned:

#151 (comment)

any solution connecting to Google Play directly, with username and password, is using an old Android 4.4 from 2013. back then you could authenticate with just a password, as long as you could mimic the TLS signature of an Android device. since Android 5 (2014), thats no longer the case. I would again strongly recommend that APKeep either drop username/password login to Google Play outright, or update the code to support the current JavaScript login (probably impossible), or support cookie header authentication, as my project does:

https://github.com/3052/google

@codeurimpulsif
Copy link
Contributor

@3052 Yes thanks, but I still don't understand why the 0.15.0 binary from this Github repository works and not the exact same version when compiled from source.

@Hainish
Copy link
Member

Hainish commented Apr 5, 2024

Google migrated to the Play API v3, which is supported in 0.16.0. This should be fixed.

@Hainish Hainish closed this as completed Apr 5, 2024
@3052
Copy link

3052 commented Apr 5, 2024

just to clarify the above, password login is NOT supported anymore with Apkeep, same as my code. instead, you have to provide OAuth token or Aas token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests