Calling all `tap-asana` users... How did y'all get...
# troubleshooting
c
Calling all
tap-asana
users... How did y'all get the refresh token from Asana?
r
@connor_lough, Obtaining a Refresh Token: Run the following python script to obtain an authorization code:
import asana
import requests
client = asana.Client.oauth(
client_id='CLIENT_ID',
client_secret='CLIENT_SECRET',
redirect_uri='urn:ietf:wg:oauth:2.0:oob'
)
# Run to get authorization
(url, state) = client.session.authorization_url()
print(url)
response = requests.get(url)
print(response)
You should see a URL with a 200 response code. Now Navigate to the URL provided and authorize your application. You’ll then be redirected to a page with an authorization code. With your authorization code, now run the following script:
import asana
import requests
client = asana.Client.oauth(
client_id='CLIENT_ID',
client_secret='CLIENT_SECRET',
redirect_uri='urn:ietf:wg:oauth:2.0:oob'
)
# Run to get Refresh Token
code = 'INSERT AUTH CODE HERE'
token = client.session.fetch_token(code=code)
print(token['refresh_token'])
Now you should have the refresh token for the configuration