OAuth Code Samples / Libraries

This page has samples you can use to get started with Asana's OAuth and SDKs.

You can explore OAuth client libraries by language here.

JavaScript

There are many client libraries you can use to manage the OAuth grant flow in Node.js or Javascript.

Note: Asana OAuth currently does not support making token requests from a browser for security reasons.

Testing in Postman

To quickly test Asana OAuth with scopes:

  1. Use Asana's Postman Collection
  2. In the developer console, set your app's redirect URL to:
https://oauth.pstmn.io/v1/callback
  1. Under Manage Distribution on the left sidebar of the developer console, make sure that the Asana workspace for your user can access your app under Specific workspaces or choose Any workspace.
  1. In Postman, select Asana at the top level of the collection, then select the Authorization tab. Enter these settings (leave defaults for other settings):
  • Auth Type: OAuth 2.0
  • Grant Type: Authorization Code
  • Callback URL: https://oauth.pstmn.io/v1/callback
  • Auth URL: https://app.asana.com/-/oauth_authorize
  • Access Token URL: https://app.asana.com/-/oauth_token
  • Client ID: (enter your test ID)
  • Client Secret: (enter your secret from the Asana developer console)
  • Scope: (space separated list of scopes from the sheet above) (e.g., tasks:read tasks:write projects:read, no quotes)
  • State: (enter a random string like 1234)
  1. Select Get New Access Token
  2. The Asana consent screen should load if there is no error. Select Allow. You should be redirected back to Postman
  3. If successful, you should have a model with a new access token. You can optionally give the token a name under Token Name
    1. Select Use Token
    2. Select Save (if you don’t save, the token is there, but not used yet in your collection)

Now you should be able to use this call in Postman. Be sure that when looking at an endpoint, on the Authorization tab, Auth Type is set to Inherit auth from parent.


Asana Home
Asana helps you manage projects, focus on what's important, and organize work in one place for seamless collaboration.
© 2023 Asana, Inc.