Giter Site home page Giter Site logo

Comments (1)

jv-asana avatar jv-asana commented on August 16, 2024

Hi @juliofarah,

That's correct. The new version of our node library does not have an internal helper function for OAuth-2 based authentication. We have had some issues with this internal helper function in the past with some of our other libraries so we didn't implement it for the new client library versions. Developers can use an external OAuth 2.0 library like passport-oauth2
to help them implement OAuth 2.0 for their app server. Or they could use a request library like axios and implement OAuth through there like you are. That being said, I'll take a note of this and bring this up with our team to see if we can add this feature back into a future update of our node library.

As for your issue with OAuth. I think you might want to catch the error from axios to access the error Asana is throwing back in the response. For example instead of:

    const tokenResponse = await axios.post(`https://app.asana.com/-/oauth_token`, body, config);

You might want to try:

  let tokenResponse = null;
  try {
      tokenResponse = await axios
      .post("https://app.asana.com/-/oauth_token", body, config);
  } catch (err) {
      // Print Asana error
      console.log(err.response.data.error_description)
  }

Here are some of my guesses to what your error might be:

  1. The redirect URL you provided in your code does not match the Redirect URLs you specified in the developer console (https://app.asana.com/0/my-apps/<YOUR_APP_ID>/oauth) (See #2: https://developers.asana.com/docs/oauth#register-an-application)
  2. Edit your manage distribution settings to allow access to your target workspace or any workspace (See How to share your app)

Let me know if you are able to see the error message from Asana

from node-asana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.