So i have gone through all the instructions here OAuth using the node-oauth endpoint to run the endpoint locally and call the asana app to get the access token. The .js seems to work fine if i have my app distributed in Any Workspace. If i try to distribute it to just one workspace that i belong to then i get “invalid client” error in the authorization endpoint. If i set it to Any Workspace then i get the token back in response(valid for 1 hour). So this is the example response i get in the server:
***** Response from the token exchange request:
{
access_token: ‘ey*w’,
token_type: ‘bearer’,
expires_in: 3600,
data: {
id: 1201345339049167,
gid: ‘1201345339049167’,
name: ‘John Paraskevopoulos’,
email: ‘jparaske@greenpeace.org’
},
refresh_token: '2/120167/12067’
}
I then use that token as bearer in Postman to do a get request such as:
https://app.asana.com/api/1.0/scim/Users?filter=userName eq “jparaske@greenpeace.org”
and the error i get is:
{
“errors”: [
{
“message”: “One of the following OAuth scopes must be present to use this endpoint: admin.scim.users:read, scim”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: Errors”
}
]
}
I do not get “Not Authorised” error which means my token is not a SCIM one but still there seems to be an issue with permissions. Could this be related to Distribution? Anyone else had similar issues or can provide insight?
Thanks
John