[Tip]New Google Auth Fix
Since GetDeviceCode(), returns status 401 and a personal ClientId and ClientSecret throw AccessTokenExpiredException(), i found this 2 usefull links: https://github.com/Mila432/Pokemon_Go_API/blob/master/login.py and https://github.com/vemacs/GPSOAuthSharp Combining those 2 we can login with a google account:
- Download , change GPSOAuthSharp project to .Net 4.5 , and compile.
- Add a reference to GPSOAuthSharp.dll in your Pokemon-Go-Rocket-API project
- In Pokemon-Go-Rocket-API/PokemonGo/RocketAPI/Client.cs , add
using DankMemes.GPSOAuthSharp;
comment lines 91 to 109:
GoogleLogin.TokenResponseModel tokenResponse = null;
if (string.IsNullOrEmpty(_settings.GoogleRefreshToken) && string.IsNullOrEmpty(AccessToken))
{
var deviceCode = await GoogleLogin.GetDeviceCode();
tokenResponse = await GoogleLogin.GetAccessToken(deviceCode);
_accessToken = tokenResponse.id_token;
ColoredConsoleWrite(ConsoleColor.White, $"Put RefreshToken in settings for direct login: {tokenResponse.refresh_token}");
_settings.GoogleRefreshToken = tokenResponse.refresh_token;
AccessToken = tokenResponse.refresh_token;
}
else
{
if (!string.IsNullOrEmpty(_settings.GoogleRefreshToken))
tokenResponse = await GoogleLogin.GetAccessToken(_settings.GoogleRefreshToken);
else
tokenResponse = await GoogleLogin.GetAccessToken(AccessToken);
_accessToken = tokenResponse.id_token;
}
and add those code on line 110:
string email = "YOUR GMAIL";
string password = "YOUR PASSWORD";
GPSOAuthClient _GPSOclient = new GPSOAuthClient(email, password);
Dictionary<string, string> _GPSOresponse = _GPSOclient.PerformMasterLogin();
/* string json = JsonConvert.SerializeObject(_GPSOresponse, Formatting.Indented);
Console.WriteLine(json); */
if (_GPSOresponse.ContainsKey("Token"))
{
string token = _GPSOresponse["Token"];
Dictionary<string, string> oauthResponse = _GPSOclient.PerformOAuth(
token,
"audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com",
"com.nianticlabs.pokemongo",
"321187995bc7cdc2b5fc91b11a96e2baa8602c62");
/* string oauthJson = JsonConvert.SerializeObject(oauthResponse, Formatting.Indented);
Console.WriteLine(oauthJson); */
_accessToken = oauthResponse["Auth"];
}
- for account with 2-Step Verification read @murtazajafferji comment and @TehPirat3 comment
@sicheater compiled GPSOAuthSharp.dll
Strategic Breakpoints are at "if (_GPSOresponse.ContainsKey("Token"))" and " _accessToken = oauthResponse["Auth"];"
Important : this code is just a idea/adaptation of a code that i'm working on , try not store credentials in source code....A best approach is setting/getting those values from ISettings.cs and other related files
Edit: you can add "GPSOAuthSharp.cs" directly to your Pokemon-Go-Rocket-API project
Could you break that down to a third grade level haha. Programming is not my thing!
Could you do this for us in a new API for download ?
i get this
The primary reference "GPSOAuthSharp" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5". PokemonGo.RocketAPI
No problems here.
Replacing gave me a bunch of errors?
thanks! it work! just change target framework on GPSOAuthSharp to v4.5.
Hello! Can u give me source with done fix ? I cant replace, error's...
on PokemonGo.RocketAPI add this to references GPSOAuthSharp.zip (dll file) then open Client.cs next just follow the step on top. or try replace all with this Client.cs.txt change email and pass before ctrl+f5. Good luck!
@sicheater : just Change the Target Framework GPSOAuthSharp project to .Net Framework 4.5 First Post Updated. My old post was based on FeroxRev version....
errors, cant fix myself
worked like a charm, though not sure if I feel realy comfy with this code =)
Thanks, It worked! Also you explained It well.
@sdtcnylcn , this code is only to get a valid google access Token, pokestops and pokemon catching can be a temporary softban if you moved to far.
Okay, It started working to me also, for the second time. I had to discard every change I have done so far, reset every setting in Window project App.config, and now it is working! (Doing pokestops, catching pokemons, etc.) @EskimoLV Did you replace the
string email = "YOUR GMAIL";
string password = "YOUR PASSWORD";
In the new code?
@sdtcnylcn Yeah, you're probably softbanned.
There is this program called QuickSpin which uses the google auth method and it gets you unbanned within a minute quite easily, but as it uses the auth method which is messed up atm it doesn't work.. If anyone knows how to skip the auth so you can replace it with your token key it would be much appreciated. Links: http://www.ownedcore.com/forums/pokemon-go/pokemon-go-hacks-cheats/565264-quickspin-pokemongo-softban-unbanner-quickly-unbans-your-softbanned-account.html
googlelogin.cs still error @Fliperworld
Thanks it's working 💃
hello guys, when i need to enter token its crushing and forcing me to close the program any tips for this ?
@huserkmen Merhaba, Yukarida ilk paylasimda yazan seyleri yapmalisin.Ondan sonra direk giris saglayabilirsin.
this wont work if google account has 2-Step Verification