Search code examples
google-app-enginegointuit-partner-platform

Request for Request Token from Intuit IPP gives permission denied


I am doing this on my local development site without problems. But when I try to setup a new connection to a QuickBooks file from my live site, I get a permission denied error.

Here is the error returned: "Post https://oauth.intuit.com/oauth/v1/get_request_token: permission denied"

Here are the request headers

Content-Type
  application/x-www-form-urlencoded

Authorization
  OAuth oauth_consumer_key="MY_KEY",
  oauth_nonce="MY_NONCE",
  oauth_signature="MY_SIG",
  oauth_signature_method="HMAC-SHA1",
  oauth_timestamp="1377287041",
  oauth_version="1.0"

Here is the request body:

oauth_callback=http%3A%2F%2Fwww.intheloop-notes.com%2Fqb%2Fconnect%2Freturn%2F

---- EDIT ----

The response is nil altogether, I am getting an error from my Go code on:

response, err := client.Do(request)

Which is why I have added a couple of tags to this question (go and google-app-engine) to try and broaden my audience. I am pretty sure that the error is in the way that my OAuth library is sending the request. I am using this library: https://github.com/kurrik/oauth1a, which has been working just fine on my local development site, but gives me the "permission denied" error when I make the call from my live site. I think there is some difference in the way that the development app engine server creates the request from the way the live engine does, but I am not sure exactly what.

Any ideas?


Solution

  • Eureka! I figured it out! And thank you, Manas, I would not have found this solution without that last link you gave. For anyone who is wondering: I had to create a custom http.Client using the appengine.urlfetch library. Once I figured that out, the solution was simple, I just had to change one line of code that created the client into this:

    client := urlfetch.Client(appengine.NewContext(r))
    

    Problem solved!