-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Android Browser Not Launching for OAuth 2.0 #1032
Comments
Have you added an Android webbrowser handler, e.g. as in the documentation here? |
Thank you inclement for your response. No, I did not see that documentation when I searched for an answer. Thank you for pointing me there. Using the example in that doc, I got the following error. I/python ( 2524): NameError: global name 'mActivity' is not defined So I added the following lines from another section where I use jnius for other Android functions. I also updated my code where I had org.renpy.android.PythonActivity and the runtime said to change that to org.kivy.android.PythonActivity, which I did.
That then generated the following results:
I do not know what is or is not working. Below is my code that matches the results above (logger.info). Chrome does appear on the screen but nothing else happens, like starting the Google authentication (flow).
Also note in the doc example, cast is not imported with autoclass. I did not experience a runtime error because I already had declared import from jnius import autoclass, cast. |
Well, I'm an idiot and did not read the doc correctly. Thank you again inclement for your patience with my stupid mistakes. I followed the directions to add android to the requirements as written and the OAuth2.0 code is now working. For some reason, I figured I needed to add code and misread the doc. I really appreciate everyone's help with this project. If I ever become successful with this product I would like to spread the wealth with you guys who helped! |
I am trying to get the Android browser to launch running Google OAuth 2.0 python code but nothing happens after displaying the following lines in the console. The code works in Windows 7 and last year when I could compile using OSX, now it's not working on Linux buildozer compile. I cannot compile on OSX due to this issue: #924.
I/python ( 2947): Your browser has been opened to visit:
I/python ( 2947): https://accounts.google.com/o/oauth2/auth?scope=https[...]&access_type=offline
I/python ( 2947): If your browser is on a different machine then exit and re-run this
I/python ( 2947): application with the command-line parameter
I/python ( 2947): --noauth_local_webserver
I can manually launch the browser, Chrome in this instance, paste the [full] url from above, and it authenticates correctly. There are no webbrowser.py error codes or message and it doesn't time out. I searched for anything relevant to this in Android but could not find any suggestions. This is Android 4.4.2.
I asked the google/google-api-python-client forum and got this reply "the underlying library just uses the Python standard library webbrowser package. So if you upgraded python or moved to a new version of android it's possible that broke it." googleapis/google-api-python-client#379.
The text was updated successfully, but these errors were encountered: