You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A suggestion for improvement:
In setting up the Google authentication on a GUI-less machine, the auth_google.py script throws an option for "--noauth_local_webserver", but the way auth_google.py is coded, it doesn't actually work. So, here's a suggestion for improvement that uses the oauth2 parser and adds a few arguments.
!/usr/bin/env python
import sys, argparse
from oauth2client.file import Storage
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.tools import run_flow, argparser
def main():
parser = argparse.ArgumentParser(parents=[argparser])
parser.add_argument('client_id')
parser.add_argument('client_secret')
# Scopes of authorization
activity = "https://www.googleapis.com/auth/fitness.activity.write"
body = "https://www.googleapis.com/auth/fitness.body.write"
location = "https://www.googleapis.com/auth/fitness.location.write"
scopes = activity + " " + body + " " + location
flags = parser.parse_args()
flow = OAuth2WebServerFlow(flags.client_id, flags.client_secret, scopes)
storage = Storage('google.json')
run_flow(flow, storage, flags)
if __name__ == '__main__':
main()
This slight modification in the code now properly parses the "--noauth_local_webserver" out of the args no matter the order when entered in the command line.
The text was updated successfully, but these errors were encountered:
@bgtron, Thanks for the clear suggestions. Headless setup is definitely one of the top requests. Hopefully next week I will have some time to fix this and a bunch of others. Would you be willing to make some contribution for the Google Authenticator headless setup? - I guess just send the above suggestion as a PR?
Would love to have more users involved as contributors.
A suggestion for improvement:
In setting up the Google authentication on a GUI-less machine, the auth_google.py script throws an option for "--noauth_local_webserver", but the way auth_google.py is coded, it doesn't actually work. So, here's a suggestion for improvement that uses the oauth2 parser and adds a few arguments.
This slight modification in the code now properly parses the "--noauth_local_webserver" out of the args no matter the order when entered in the command line.
The text was updated successfully, but these errors were encountered: