-
Sergeant
Google Auto Login in C# Community Version
In GoogleLogin.cs enter
Code:
public static void AutomaticEnterCode(string token)
{
IWebDriver driver = new ChromeDriver(@"YOURLINK\Desktop\SOMEFILES\Selenium"); // POINT ME TO SELENIUM FOLDER PLEASE
driver.Navigate().GoToUrl("http://www.google.com/device");
IWebElement searchEmail = driver.FindElement(By.Id("Email"));
searchEmail.SendKeys("YOURGMAIL");
IWebElement searchNextButton = driver.FindElement(By.Id("next"));
searchNextButton.Click();
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(6));
IWebElement searchPassword = driver.FindElement(By.Id("Passwd"));
searchPassword.SendKeys("YOURPASSWORD");
searchPassword.Submit();
IWebElement searchInputCode = driver.FindElement(By.Id("single_input_user_code"));
searchInputCode.SendKeys(token);
searchInputCode.Submit();
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(50));
Thread.Sleep(10000);
IWebElement searchApproveButton = driver.FindElement(By.Id("submit_approve_access"));
searchApproveButton.Click();
driver.Close();
}
Then replace
Code:
internal static async Task<TokenResponseModel> GetAccessToken()
{
var deviceCodeResponse = await GetDeviceCode();
Console.WriteLine("Please visit " + deviceCodeResponse.verification_url + " and enter " +
deviceCodeResponse.user_code);
//Poll until user submitted code..
TokenResponseModel tokenResponse;
do
{
await Task.Delay(2000);
tokenResponse = await PollSubmittedToken(deviceCodeResponse.device_code);
} while (tokenResponse.access_token == null || tokenResponse.refresh_token == null);
Console.WriteLine("Logged in Google Account..");
return tokenResponse;
}
With
Code:
internal static async Task<TokenResponseModel> GetAccessToken()
{
var deviceCodeResponse = await GetDeviceCode();
Console.WriteLine("Please visit " + deviceCodeResponse.verification_url + " and enter " +
deviceCodeResponse.user_code);
var GoogleToken = deviceCodeResponse.user_code.ToString();
AutomaticEnterCode(GoogleToken);
//Poll until user submitted code..
TokenResponseModel tokenResponse;
do
{
await Task.Delay(2000);
tokenResponse = await PollSubmittedToken(deviceCodeResponse.device_code);
} while (tokenResponse.access_token == null || tokenResponse.refresh_token == null);
Console.WriteLine("Logged in Google Account..");
return tokenResponse;
}
You need to get nuget
Done, enjoy leaving your bot unattended.
Credits to whoever came up with the idea, i only adapted it.
(Yes it can be done much nicer but **** it, it works )
https://www.mediafire.com/?5lsd21uj2uba1t7 (Selenium folder for the lazy)
Click, Project > Add Reference > Browse to folder to add the dll's then add in the top of GoogleLogin.cs
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
Last edited by dv999; 07-21-2016 at 06:23 PM.
-
Post Thanks / Like - 2 Thanks
-
Member
Everything makes sense except I didn't get this:
Originally Posted by
dv999
You need to get nuget
-
Sergeant
You need to reference the dlls inside this folder and point to the folder
https://www.mediafire.com/?5lsd21uj2uba1t7
-
Member
but google permanent auth is already working
-
Sergeant
Originally Posted by
expander8
but google permanent auth is already working
Not working for me, anyways can be usefull to some people botting multiple accounts
-
Member
after 30 minutes the bot restarts without needing to put the code on browser
-
Sergeant
Not for me no. If it does for you, i'm happy.
-
Member
did you put the token in the user file?
-
-
Sergeant
Originally Posted by
expander8
did you put the token in the user file?
Hehe, yes don't worry. I'm not stupid, i prefer this method because it's easier to manage multiple accounts when i use my own GUI version.
@Trololo_xyz do you have chrome installed?
-
Member
Originally Posted by
dv999
Hehe, yes don't worry. I'm not stupid, i prefer this method because it's easier to manage multiple accounts when i use my own GUI version.
@Trololo_xyz do you have chrome installed?
yeah this was my fail :P
-
Member
You steal the idea and code from some other!
Dont sell it as yours please
-
Member
but it didnt work when you have more accs in one email -.-
-
Sergeant
Originally Posted by
S3lent
You steal the idea and code from some other!
Dont sell it as yours please
Who is selling shit? I adapted the code from another version.
Remove your retard hat please this is free.
@Trololol_xyz
Sorry, i didn't even know that was a thing but you can adapt it to work with that too.
Last edited by dv999; 07-21-2016 at 07:15 PM.
-
Member
Where is googlelogin.cs ?