Nuno Vidal
Posts: 0
Joined: Tue Nov 12, 2013 10:29 am

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

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

Hi Nuno,

Please post a public link to your app.

Nuno Vidal
Posts: 0
Joined: Tue Nov 12, 2013 10:29 am

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

Hi Katia,

Thanks for looking into my question.

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

Nuno Vidal
Posts: 0
Joined: Tue Nov 12, 2013 10:29 am

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

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
Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

Hi Nuno,

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

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.

Return to “Issues”