I’m trying to authenticate myself from a VM without a web-browser. I’m following this link: https://developers.google.com/gmail/api/quickstart/python
Unfortunately when I run: $python3 quickstart.py
, I get:
Traceback (most recent call last):
File "/home/cloudshell-user/phishing_gmail/quickstart.py", line 55, in <module>
main()
File "/home/cloudshell-user/phishing_gmail/quickstart.py", line 31, in main
creds = flow.run_local_server(port=0)
File "/home/cloudshell-user/.local/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 447, in run_local_server
webbrowser.get(browser).open(auth_url, new=1, autoraise=True)
File "/usr/lib64/python3.9/webbrowser.py", line 65, in get
raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser
Which makes sense since I’m in a AWS VM without browser. Is there anyway to bypass this step in any other way?
Thanks!