Obtaining connection values for Asana from an App Connect Designer instance in a containerized environment (local connector)

If you're using an App Connect Designer instance within an installation of IBM Cloud Pak® for Integration or IBM® App Connect Enterprise certified container, and you enabled locally available connectors, you can use a local connector to connect to your Asana account.

To use a local connector to connect to your Asana account, complete the following steps. (For more information about using an App Connect Designer instance in a containerized environment, see Creating and managing flows for an API in App Connect Designer.)

  1. Complete the connection fields that you see in the App Connect Designer Catalog page or flow editor. If necessary, work with your Asana administrator to obtain these values.
    • Access Token: The OAuth access token to be used to authenticate App Connect with your Asana account.
    • Refresh token: The OAuth refresh token to be used by App Connect to connect to your Asana account.
    • Client ID: The Client ID that App Connect uses to identify itself to Asana.
    • Client secret: The Client secret that App Connect uses to identify itself to Asana.
  2. Click Connect

An account is created in App Connect. .

Tip:

Before you use the account that is created in App Connect in a flow, rename the account to something meaningful that helps you to identify it. To rename the account on the Applications and APIs page, select the account, open its options menu (⋮), then click Rename Account.

  • The general process to get the OAuth authentication values that are needed to connect to Asana is as follows.

    1. Generate a client ID and client secret.

      A client ID and client secret are generated by registering an application in the Asana developer app console.

      1. Open the "Apps" tab of your account settings.
      2. Click Manage Developer Apps
      3. Click + New app
      4. Specify the app name to uniquely identify the app in the Authorized Apps list on the "Apps" tab, agree to the API terms and conditions, and then click Create app.
        Tip: Use a name that helps you identify its use for IBM App Connect

        This displays a page with the Client ID and Client Secret values. Copy the values for use later.

      5. Select the checkbox This is a native or command-line app
    2. Generate an access token and refresh token.

      An access token is generated from the client ID, client secret, redirect URI, and authorization code.

      1. Copy the following link, and replace CLIENTID with the client ID you generated when you registered the application:
        https://app.asana.com/-/oauth_authorize?response_type=code&client_id=CLIENTID&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&state=<STATE_PARAM>

        Open a new tab and paste the link with your client ID. This displays a dialog for you to grant the app (for App Connect) permission to access your Asana account. Click Allow to continue.

        This displays a code that is needed to generate an access token. Copy the code for use later.

      2. Make a Post call to https://app.asana.com/-/oauth_token with the following parameters:
        grant_type:authorization_code
        client_id: xxxx
        client_secret: xxxx
        redirect_uri: urn:ietf:wg:oauth:2.0:oob
        code: <Code generated in previous step>
        For example:
        curl -X POST --data "grant_type=authorization_code&client_id=1234209873456109&client_secret=101a123b2c...ea2021&redirect_uri=urn:ietf:wg:oauth:2.0:oob&code=1/633050198476321:978...ef151066a" https://app.asana.com/-/oauth_token
        The response to the POST call returns the access token and refresh token; for example:
        {
          "access_token": "eiE0eXAvIeRKV1QiL.ENcO8mWetanDRYNB2THAkemY0a29fVnee7NU",
          "token_type": "bearer",
          "expires_in": 3600,
          "data": {
            "id": 633030196876589,
            "gid": "633030196876589",
            "name": "John Smith",
            "email": "jsmith@email.com"
          },
          "refresh_token": "1/234050678483616:634...e101e2a3cbb6de09"
        }

    In App Connect Designer you can specify the access token, refresh token, client ID, and client secret to connect App Connect to your Asana account.