NicklasWallgren / PokemonGoAPI-PHP

Pokemon Go API PHP library
BSD 2-Clause "Simplified" License
130 stars 51 forks source link

Error with Google auth #35

Closed Raphaelbm closed 8 years ago

Raphaelbm commented 8 years ago

Hello !

First, thanks for this API !

I try this with my login:

$application = new ApplicationKernel('EMAIL', 'PASSWORD', Factory::AUTHENTICATION_TYPE_GOOGLE);

And I had this arror:

Fatal error: Uncaught exception 'NicklasW\PkmGoApi\Authenticators\Exceptions\AuthenticationException' with message 'Invalid user credentials. Response: 'Error=NeedsBrowser Url=https://accounts.google.com/signin/continue?... ErrorDetail=To access your account, you must sign in on the web. Touch Next to start browser sign-in.'

So, someone can help me ? I have to log me in the browser. I don't understand this error.

Ni42 commented 8 years ago

Do you have 2-factor authentication active on your Google Account? Logging in using a PTC account is probably easier, they are not so concerned with login security.

Raphaelbm commented 8 years ago

Yes but i play with my google account ! I will try in an other browser.

Thank you !

Raphaelbm commented 8 years ago

Google block the connexion.

So i will test with PTC login.

Ni42 commented 8 years ago

Also, there's always the risk they can detect you using third-party APIs, since not all the messages are decoded yet, so you wouldn't want to loose your main account, would you? As long as you're not using the map functions, it's not exactly probable, but better be safe than sorry...

Raphaelbm commented 8 years ago

I understand, it's normal ! I made an other PTC account for the API. That is work fine ! :)

Raphaelbm commented 8 years ago

If I launch this Url, Im redirecting on google auth but there is an infinite "One moment please..."

How can I fix the Google login ?

Ni42 commented 8 years ago

Try going here after you got that message, then try logging in again: https://accounts.google.com/b/0/DisplayUnlockCaptcha

Yolo390 commented 8 years ago

Hey guys,

i have a similary problem: " Fatal error: Uncaught NicklasW\PkmGoApi\Authenticators\Exceptions\AuthenticationException: Invalid user credentials. Response: 'Error=BadAuthentication' in D:\Programmes\wamp64\www\PokemonGo-API-PHP\src\Authenticators\GoogleOauth\Parsers\TokenParser.php on line 43"

I use PTC connection in RetrievePlayerStatsExample class.

public function run()
{
    // Initialize the pokemon go application
    $application = new ApplicationKernel(
        'MY_ACCOUNT', 'MY_PASSWORD', Factory::AUTHENTICATION_TYPE_PTC);

Loggin and password are good. Any idea?

Raphaelbm commented 8 years ago

You have a login and a display name when you create an PTC account. Maybe you are not using your login.

Don't forget to validate your account by mail !

NicklasWallgren commented 8 years ago

@Raphaelbm We don't support 2-factor authentication at this point.

Raphaelbm commented 8 years ago

@NicklasWallgren Ok ok. Thank you !

Yolo390 commented 8 years ago

I use the login and not the display name ;) My account is already validate too.

It is work for you with PTC? thanks for your answer! :)

EDIT: re install and it's work!