googleplay-api icon indicating copy to clipboard operation
googleplay-api copied to clipboard

I am getting Bad authnetication error

Open d78ui98 opened this issue 3 years ago • 13 comments

[ERROR] Bad authentication, login or password incorrect ('server says: BadAuthentication')

d78ui98 avatar Mar 23 '21 08:03 d78ui98

The email address used (or its password) is wrong, check it again by trying to connect to your Gmail account (via a browser).

ouaguid avatar Mar 26 '21 00:03 ouaguid

Hello ouaguid. Thanks for the reply. The email and password used were right. Was still not able to connect. But now I am able to fix this issue. Thank you anyway :)

d78ui98 avatar Mar 26 '21 16:03 d78ui98

I am also getting a "BadAuthentication" response from the server. I have verified the password and email is correct and attempted to unlock the account here "https://accounts.google.com/b/0/DisplayUnlockCaptcha". I have also tried multiple different accounts. @d78ui98 How did you end up getting auth working again?

nosnikta10 avatar Mar 28 '21 06:03 nosnikta10

Turns out to be the version of requests not playing nice with the lib. I downgraded from requests version 2.25.1 to 2.20.0 and now I can sign in. I hope that helps someone else having the same issue.

nosnikta10 avatar Mar 28 '21 08:03 nosnikta10

I havn't tracked all the packet but the Raccoon is working well. I am using the GSFID and token from it.

ryu-s-r avatar Apr 01 '21 14:04 ryu-s-r

I found the problem. it was proxy in my case.

ryu-s-r avatar Apr 01 '21 17:04 ryu-s-r

I found the a possible explanation: the auth header different for different auth type: if you use token, the auth header sould be in googleplay.py#L144 : headers["Authorization"] = "Bearer %s" % self.authSubToken

But if you use username/password (i use "app password"), the auth header works this: headers["Authorization"] = "GoogleLogin auth=%s" % self.authSubToken

Elbandi avatar Jun 14 '21 09:06 Elbandi

Turns out to be the version of requests not playing nice with the lib. I downgraded from requests version 2.25.1 to 2.20.0 and now I can sign in. I hope that helps someone else having the same issue.

The reason for why you have to do this is that the Auth API does TLS fingerprinting, so the client has to have a specific TLS signature otherwise the server rejects the requests.

I found the problem. it was proxy in my case.

For this same reason, the auth API cannot be used with most proxies because the proxy messes with the TLS fingerprint. I did some experimentation with the fingerprinting and found a valid fingerprint that at least for me has worked reliably: https://github.com/Jarijaas/go-googleplay/tree/02045ae52a0a2f89f909d2492a53f3961c51bfaf/pkg/auth/utils.go#L95-L138

Jarijaas avatar Jun 27 '21 13:06 Jarijaas

Here is a quick and dirty patch for the Bad Authentication issue: https://github.com/gentoolinux/googleplay-api/commit/6e4c7a47b59f2a1a512b05380127f87369e308ff This solves the issue for me but some advanced programmer should check this before merging it. My patch is inspired by https://github.com/simon-weber/gpsoauth/commit/6a52a38b35db9b0732d4cec04f734963ca1dc578

gentoolinux avatar Jun 27 '21 14:06 gentoolinux

I havn't tracked all the packet but the Raccoon is working well. I am using the GSFID and token from it.

Racoon also returned "Bad authentication" error

ahm750 avatar Aug 28 '21 05:08 ahm750

Turns out to be the version of requests not playing nice with the lib. I downgraded from requests version 2.25.1 to 2.20.0 and now I can sign in. I hope that helps someone else having the same issue.

I downgraded urllib3<1.26.0 (which is same as downgrading requests) and there is no more BadAuthentication. I think there are some ssl errors causing this.

If you stick to urllib3>1.26.0, you can try https://github.com/NoMore201/googleplay-api/pull/145. I think it is already fixed.

martinwang2002 avatar Feb 27 '22 23:02 martinwang2002

started getting this issue again lately while trying to login. 2fa with Playstore app password. tried solutions in linked issues and PRs, the issue persist tried with/without vpn, the issue persist

did anybody successfully login in the last couple of days?

NachumOlman avatar Apr 24 '22 10:04 NachumOlman

started getting this issue again lately while trying to login. 2fa with Playstore app password. tried solutions in linked issues and PRs, the issue persist tried with/without vpn, the issue persist

did anybody successfully login in the last couple of days?

My fork works for me. I also uploaded it to pypi. https://github.com/besendorf/googleplay-api

besendorf avatar Apr 24 '22 14:04 besendorf