Page 2 of 3

Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 2:49 pm
by maxkatz

If you copy the Authorization header and set it in Test, it should work. You could get it when you run the page (from Chrome Developer Tools or Firebug)


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 2:51 pm
by Rupert Marx

How do I set it? Not sure....


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 2:51 pm
by Rupert Marx

Can you send a screenshot?


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 2:53 pm
by maxkatz

Run the page with Chrome Developer Tool open, go to Network tab. Select the request and open Headers tab. You should see all the headers sent.


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 3:23 pm
by Rupert Marx

Where do I drop it in tiggzi?


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 3:23 pm
by maxkatz

In Test window, value for Authorization header.


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 3:33 pm
by Rupert Marx

I am getting this error:
{"error":"Invalid OAuth credentials or signature: Key not provided"}

But here is that I get back:

Request URL:http://project.tiggzi.com/rest/tunnel...
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:application/vnd.stackmob+json; version=0
Accept-Charset:ISO-8859-1,utf-8;q=0.7,;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:__qca=P0-873715056-1345317052849; __utma=169854756.1161330099.1344081146.1345308652.1345384389.4; __utmc=169854756; __utmz=169854756.1344081146.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); JSESSIONID=3163+s4i8Q6gAT3AM+DD+7+x.undefined; JSESSIONIDSSO=gMVyqefcptkQpoDIS-XHoGaZ.undefined
Host:project.tiggzi.com
Referer:http://project.tiggzi.com/view/15fba8...
tiggzi-key:1345390074049
tiggzi-proxy-url:http://api.mob1.stackmob.com/messages
tiggzi-rest:1625037
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.79 Safari/537.1
Query String Parametersview URL encoded
Authorization:OAuth realm="",oauth_timestamp="1345390649",oauth_nonce="G2rlR2bwsBAw349hi",oauth_signature_method="HMAC-SHA1",oauth_consumer_key="05ed905a-4a3b-4b5f-9a74-baf00b07bb1d",oauth_signature="fza6xa9t3%2Fv2Zhw6rlbSwz%2BbIMY%3D"
Response Headersview source
Access-Control-Allow-Origin:
Cache-Control:private
Connection:keep-alive
Content-Type:text/plain
Date:Sun, 19 Aug 2012 15:27:55 GMT
Expires:0
Pragma:cache
Server:nginx
Set-Cookie:JSESSIONIDSSO=gMVyqefcptkQpoDIS-XHoGaZ.undefined; Domain=.tiggzi.com; Path=/
Transfer-Encoding:chunked

I think it could be a copy/past issue? From stackmob to tiggzi?


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 7:11 pm
by maxkatz

What did you set for Authorization header?


Mapping response to mobile list item problem

Posted: Sun Aug 19, 2012 8:08 pm
by Rupert Marx

For authorisation I run the below Java script:

function getAuth(requestMethod, url){

Code: Select all

 if (url == null) { 
    url = '[url=http://api.mob1.stackmob.com/messages']http://api.mob1.stackmob.com/messages'[/url]; 
 } 

 var key = 'paste_your_key';   
 var secret = 'paste_your_key'; 

 var accessor = { consumerSecret: secret,  tokenSecret: "" }; 

 var message = { method: requestMethod, action: url, parameters:OAuth.decodeForm("") }; 

 message.parameters.push(['oauth_timestamp', OAuth.timestamp()]); 
 message.parameters.push(['oauth_nonce', OAuth.nonce(17)]); 
 message.parameters.push(['oauth_signature_method', 'HMAC-SHA1']); 
 message.parameters.push(['oauth_consumer_key', key]); 

 OAuth.SignatureMethod.sign(message, accessor); 
 var auth = OAuth.getAuthorizationHeader("", message.parameters); 

 return auth;  

}

It should generate this:

Authorization: OAuth realm="", oauth_signature="iTql2Xa1ZYzJaQLtoqt3fuDTIYQ%3D", oauth_nonce="57929598291674951", oauth_signature_method="HMAC-SHA1", oauth_consumer_key="05ed905a-4a3b-4b5f-9a74-baf00b07bb1d", oauth_timestamp="1345406804"

But I am not sure how to test this? I can not see how to set it manually in test window.


Mapping response to mobile list item problem

Posted: Mon Aug 20, 2012 3:20 am
by maxkatz

Try setting the Authorization header in Test to this:

OAuth realm="", oauth_signature="iTql2Xa1ZYzJaQLtoqt3fuDTIYQ%3D", oauth_nonce="57929598291674951", oauth_signature_method="HMAC-SHA1", oauth_consumer_key="05ed905a-4a3b-4b5f-9a74-baf00b07bb1d", oauth_timestamp="1345406804"