Hello, I’m new to Asana and OAuth, but know Python quite well. I’m looking at:
https://github.com/Asana/python-asana/blob/master/examples/example-script.py
It all makes sense, and works, but this part is very painful for user interaction and needs to be avoided for end-users to accept the tool I’m building. Am I missing some basic ‘requests.??’ functionality to return the code without forcing user interaction?
(url, state) = client.session.authorization_url()
import webbrowser
webbrowser.open(url)
# Chrome opens, and user must copy and paste a string!!
code = sys.stdin.readline().strip()
# code = my.gui.linereader()
# exchange the code for a bearer token
token = client.session.fetch_token(code=code)