Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49206

JSONP Server with key authentication

$
0
0

I'm building an iPhone app using JQTouch/JQuery and PhoneGap, and so I was hoping the services module would allow me to pull content via javascript into my iPhone application from Drupal. In theory.

It took me all day to figure out why my calls weren't working with the normal JSON server...because it's cross-domain. Ugh.

So now I'm going to focus on JSONP, which should solve THAT problem. But I can't really find a clear explanation of how to do anything with key authentication in javascript. Or would key authentication even be necessary here? I do want it as secure as possible.

I already downloaded http://point-at-infinity.org/jssha256/ for the hash functions I need (I think I need anyway).

As a test, I want to try something like:

$.ajax({
     type: "POST",
     url: service_url,
     dataType: "jsonp",
     data: {"method": "node.get", "nid": 15},
     success: function(msg){
       alert( "Data: " + msg["#data"].nid );
     }
});

I assume this would work with authentication off, assuming I've made the proper modifications to the json_server module so it accepts jsonp. But what do I add to the data object if I am using key authentication with session ids?

Thanks!


Viewing all articles
Browse latest Browse all 49206

Trending Articles