Having issues connecting to Asana using Oauth2 in python

I am currently trying to access Asana using python. If I try connecting using a personal access token (client = asana.Client.access_token(‘‘)), I am able to access my projects and workspace. However, when I try connecting using Oauth2 (
client = asana.Client.oauth(
client_id=’
’,
client_secret=‘***’,
redirect_uri=‘urn:ietf:wg:oauth:2.0:oob’
)) and check if I am authorized using client.session.authorized, it returns false. I was wondering if anyone knew the answer to this issue (or knew the time it takes for a personal access token to expire)

The message is a bit hard to read with the formatting being all wrong… You should re-publish and use backquotes around code.

I use personal access tokens all the time in both Postman requests and code, works well. Can you share the full bit of code creating the Asana client maybe?

Hi All,

I am having similar issues connecting to Asana, but I get stuck with the personal access token, My code:

import asana
client = asana.Client.access_token('1/xxxxxx:yyyyyyy')
me = client.users.me()

error message:
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1124)

I created the PAT last week, refreshed it today.
Any thoughts / help?

Regards, Henk

Sorry for the formatting errors. I was thinking of using the personal access tokens as well initially, but it looks like they expire. The code I am using for connecting with Oauth2 is
client = asana.Client.oauth(
client_id= —,
client_secret= —,
redirect_uri=‘urn:ietf:wg:oauth:2.0:oob’
)

Personal Access Tokens do NOT expire.

Are you giving a real client id and secret from the app you created? The redirect URI you give is an IPV6? I have no idea if that works.
Do you get a specific error?