OAuth with Asana

  1. SDK Version: 46.0.10
  2. Platforms(Android/iOS/web/all): iOS

I’m trying to OAuth with the Asana API using the Expo SDK. I’m using Expo Go and the Simulator, and thus using the proxy. The config is as such:

    const Endpoints = {
        authorizationEndpoint: 'https://app.asana.com/-/oauth_authorize',
        tokenEndpoint: 'https://app.asana.com/-/oauth_token',
        revocationEndpoint: 'https://app.asana.com/-/oauth_revoke',
    };

    const [request, response, promptAsync] = useAuthRequest(
        {
            clientId: 'XXXXXX',
            scopes: ['default', 'profile'],
            redirectUri: makeRedirectUri({
                scheme: 'com.beaufour.asanatask',
                useProxy: true,
            }),
        },
        Endpoints
    );

When I trigger promptAsync(), the browser opens, I can log into Asana and auth, etc. but I end up with a screen saying “Something went wrong trying to finish signing in. Please close this screen to go back to the app” and the error response is {"type": "cancel"}. If I look in Safari, I can see the request succeeding to Asana, and it then hits https://auth.expo.io/@beaufour/asanatask?code=XX&state=XXX.

I have this in app.json:

"expo": {
  ...
    "scheme": "com.beaufour.asanatask",
  ...
}

And the scheme seems to be registered fine too:

$ npx uri-scheme list
› iOS: Schemes for config: ./ios/AsanaTask/Info.plist
› com.beaufour.asanatask://

What’s going wrong here?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.