Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using only JQuery to update Twitter (OAuth)

we would like to send a JSON update command to twitter, but only using JQuery, not having to go to the webserver and have it done in PHP.

The thing I can't grasp really is how to send the user credentials in the JQuery/JSON twitter API call. Our user credentials are from Twitter's OAuth.

thanks, cheers!

like image 697
Trident Splash Avatar asked Nov 20 '09 10:11

Trident Splash


2 Answers

If you did this, you would have to embed your application's Key, Secret (!), and the user's token into the webpage (which is then exposed to the user). I don't think this is a good idea. (And the risk of compromise is the same.)

This might be the thinking of most other people - however there is a Javascript OAuth library. But it's not inteded for the use inside websites (cross-domain ajax limitation) but rather for other JS platforms (like Chrome/Jetpack plugins or Vista Sidebar widgets).

like image 107
Marcel Jackwerth Avatar answered Oct 05 '22 03:10

Marcel Jackwerth


Iam not 100% sure, but i think you need an serverside script to authenticate with twitter.

check out this link:

Jitter

its an api implementation for Jquery and Twitter (but altough has an PHP Script to handle some things.)

like image 45
opHASnoNAME Avatar answered Oct 05 '22 04:10

opHASnoNAME