Nodejs integration for the oauth authorization

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elbowprogrammer
    Member
    • Jan 2016
    • 58

    Nodejs integration for the oauth authorization

    I need to create an integration with quickbooks, but it doesn't have a client-based oauth library like google does. Are they any disadvantages as to using nodejs for the oauth integration? I am using http://oauth.net/core/1.0a/#anchor43, as a reference as to how to obtain tokens, but I'm a bit confused on the oauth_signature. I used http://forum.espocrm.com/forum/devel...tom-javascript as reference to including an external library.They have a custom button ("ipp:connectToIntuit"), but the button doesn't show on the page. Also not sure where to include the code below:
    PHP Code:
    var parser = document.createElement("a");  ​parser.href = document.url;     intuit.ipp.anywhere.setup({    menuProxy:"",    grantUrl: "http://" + parser.hostname + "/pathname"  }); 
    
  • yuri
    Member
    • Mar 2014
    • 8484

    #2
    It wouldn't recommend because users of your plugin will need to deploy nodejs app.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • elbowprogrammer
      elbowprogrammer commented
      Editing a comment
      I added the &quot;intuit.ipp.anywhere-1.3.3.js&quot; in client/libs directory. Then I add the path in jsLibs.json file. The intuit button is &quot;<ipp:connectToIntuit></ipp:connectToIntuit>&quot;, and I add the button to the tpl file, but it doesn't show on the page. And where I include the code below?
      PHP Code:
      var parser = document.createElement(&quot;a&quot;);
      parser.href = document.url;
      intuit.ipp.anywhere.setup({
      menuProxy:&quot;&quot;,
      grantUrl: &quot;redirectUrl&quot;
      }); 
      
      If I can get the button to visible and execute the granturl the way it's suppose to be, that would be the first accomplishment down the long road of integrating quickbooks. Would very much appreciate your help yuri .
      Last edited by elbowprogrammer; 06-22-2016, 07:56 PM.
  • elbowprogrammer
    Member
    • Jan 2016
    • 58

    #3
    I add the intuit library to jslibs.json, and add their connecttointuit button to a tpl file. I cleared the cache. Why is the button not visible? And which function would I add the code below to?
    PHP Code:
    var parser = document.createElement("a");
    parser.href = document.url;
    
    intuit.ipp.anywhere.setup({
    menuProxy:"",
    grantUrl:""
    }); 
    

    Comment

    • yuri
      Member
      • Mar 2014
      • 8484

      #4
      Did you include your lib in AMD way in Espo.define function ?
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • elbowprogrammer
        Member
        • Jan 2016
        • 58

        #5
        Yes, like so,
        PHP Code:
        Espo.define("some directory",["some dependency","lib!Intuit"] 
        

        Comment

        • yuri
          Member
          • Mar 2014
          • 8484

          #6
          and after that you can use your lib in setup or afterReder methods
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • elbowprogrammer
            Member
            • Jan 2016
            • 58

            #7
            I can't even get the button to be visible in the tpl file. Their tag is,
            PHP Code:
            <ipp:connectToIntuit></ipp:connectToIntuit> 
            
            . And that element is not visible. Their library inserts "<a href="javascript:void(0)" class="intuitPlatformConnectButton">Connect with QuickBooks</a>" and their library uses the value assigned to grantUrl to redirect me.

            Comment

            • elbowprogrammer
              Member
              • Jan 2016
              • 58

              #8
              If the connecttointuit button isn't visible, and I can't use nodejs to run oauth authentication, what is the best method?

              Comment

              • elbowprogrammer
                Member
                • Jan 2016
                • 58

                #9
                I add the intuit library in the jslibs, and I add the quickbooks button (<ipp:connectToIntuit></ipp:connectToIntuit>) to tpl file. The only time I need to use the library is when I need to setup the grantUrl, but the library makes the xml tags visible. And also the oauth is done on the server side, and there is no client-side oauth for intuit. IF I CAN GET THE BUTTON TO BE VISIBLE IN THE TPL FILE, AND HAVE THE LIBRARY DOES REDIRECTION PROCESS WHEN THE BUTTON IS CLICKED, I CAN MOVE ON TO THE NEXT STEP.
                Last edited by elbowprogrammer; 07-13-2016, 02:54 PM.

                Comment

                Working...