Page 1 of 1

POST https://appery.io/app/rest/tunnel 401 (Unauthorized) (Twitter example with Appery proxy)

Posted: Tue Nov 12, 2013 10:29 am
by Nuno Vidal

Hello everyone,

I am following the tutorial "Building a Twitter app to send tweets"(http://docs.appery.io/tutorials/build...) and hit a roadblock when invoking the requestToken service

Below is the output of the POST getting the 401 Unauthorized answer. I'm using Appery's proxy, otherwise I get the cross-origin error.

Do you spot anything wrong in the request?

Let me know if you need more input from my side to track down the problem.

Thanks for the help.
Nuno

Request URL:https://appery.io/app/rest/tunnel
Request Method:POST
Status Code:401 Unauthorized

Request Headers
Accept:application/json, text/javascript, /; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
appery-key:1xxxxxxxxxxx0
appery-proxy-url:https://api.twitter.com/oauth/request...
appery-rest:2xxxxx2
Authorization:OAuth oauth_consumer_key="4xxxxxxxxxxxxxxxxxxxxQ", oauth_version="1.0", oauth_timestamp="1384249441", oauth_nonce="Txxxxxxp", oauth_signature_method="HMAC-SHA1", oauth_signature="3xxxxxxxxxxxxxxxxxxxxxxxxxxxxD"
Connection:keep-alive
Content-Length:18
Content-Type:application/x-www-form-urlencoded
Host:appery.io
Origin:http://appery.io
Referer:http://appery.io/app/view/fxxxxxxxxxx...
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36

Form Data
oauth_callback:oob


POST https://appery.io/app/rest/tunnel 401 (Unauthorized) (Twitter example with Appery proxy)

Posted: Tue Nov 12, 2013 12:15 pm
by Kateryna Grynko

Hi Nuno,

Please post a public link to your app.


POST https://appery.io/app/rest/tunnel 401 (Unauthorized) (Twitter example with Appery proxy)

Posted: Tue Nov 12, 2013 2:43 pm
by Nuno Vidal

Hi Katia,

Thanks for looking into my question.

Here's the public link to the app:
http://appery.io/app/mobile-frame?src...


POST https://appery.io/app/rest/tunnel 401 (Unauthorized) (Twitter example with Appery proxy)

Posted: Wed Nov 13, 2013 12:36 pm
by Nuno Vidal

I should have probably included these instructions earlier.

Here's how you can access the call to the Twitter requestToken service request

  1. You can register with any user / password
  2. After login / register click the "Gear" button in the top left
  3. Click on the "+ Twitter" button

POST https://appery.io/app/rest/tunnel 401 (Unauthorized) (Twitter example with Appery proxy)

Posted: Thu Nov 14, 2013 7:27 am
by Kateryna Grynko

Hi Nuno,

Sorry, still working on it. We'll update asap.


POST https://appery.io/app/rest/tunnel 401 (Unauthorized) (Twitter example with Appery proxy)

Posted: Thu Nov 14, 2013 9:20 am
by Kateryna Grynko

preEncodeHelper.getHeader('https://api.twitter.com/oauth/request_token', {
oauth_callback: 'oob'
});/preThis code returns a list of parameters, and you try to save them in one Authorization parameter in Twitter_OAuth_RequestToken. This is the point.