Hello, I’m new to Asana and OAuth, but know Python quite well. I’m looking at:
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()
# 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)