-
Notifications
You must be signed in to change notification settings - Fork 31
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
2-Factor OAuth Login #13
Comments
Ah, yeah, I looked into this when first implementing the flow but never got around to supporting it: simon-weber/gmusicapi#168 (comment). That's a bummer that the cookie is httponly. Sounds like that really pushes things towards option 2 in the linked comment. |
When I was working on automating this with selenium a few months ago, for some reason I used the selector But also, the url that's returned in the |
Cool; good to know. |
Go to appPasswords and create one. Use this as your password. |
With selenium it's easy to get the Oauth2 token, but when I try to use it to get the google drive token, it doesn't work. Any method to get the google drive token from Oauth2? |
Since I didn't see this implemented here: If you login with
gpsoauth.perform_master_login
using your regular username and password on an account with 2 factor auth enabled, it'll return a url, and after you open that url and finish logging in, it'll then redirect you to https://accounts.google.com/o/oauth2/programmatic_auth, and there's a cookie set namedoauth_token
, which includes the OAuth token.The caveat here is that you can't use javascript (like a bookmarklet) to extract it, since the cookie is set HttpOnly, so you'll either have to manually extract it, use an extension, or something like Selenium.
You can also get that cookie by starting with the URL (in a browser) https://accounts.google.com/o/android/auth?&source=android&lang=en&langCountry=en_us&xoauth_display_name=Android%20Phone&cc=us&tmpl=new_account and logging in instead of https://android.clients.google.com/auth
The text was updated successfully, but these errors were encountered: