How to login to TP using JS

How to login to TP using JS

in API Development

Posted by: Fossilized Amber.1352

Fossilized Amber.1352

The title says it all, I am doing this in JS (javascript) and am getting an Access-Control-Allow-Origin error. This is new territory (Access-Control-Allow-Origin errors, not HTTP verbs) for me and don’t know of a good route to take to access the TP online. I’m sure someone has done this before, could you give me some pointers?

I can find my session id and I know the url is https://tradingpost-live.ncplatform.net/authenticate?session_key=, and so I am appending to that my session id and posting.

I will post my code if that is fine / asked of me.

(edited by Fossilized Amber.1352)

How to login to TP using JS

in API Development

Posted by: smiley.1438

smiley.1438

You should not get into trouble when using jQuery’s $.getJSON().
If you’re running a php based web server, you can handle it like so:

header("Access-Control-Allow-Origin: *");

see also: http://enable-cors.org/

How to login to TP using JS

in API Development

Posted by: Fossilized Amber.1352

Fossilized Amber.1352

Thank you smiley, I’m afraid its one step short of grabbing the json data – connecting to the TP online. How is the preferred method of logging into the online TP done?

My question needs to be reworded, which I will do now

How to login to TP using JS

in API Development

Posted by: smiley.1438

smiley.1438