I'm using Twitter4j and attempting to obtain and store user's Twitter access tokens to database for later tweeting. I want to do it entirely with jQuery and ajax, silently.
I have a cfc with the basic functions necessary. e.g. tHe following jquery calls a cfc function which generates the requestURL and pops open a Twitter auth window.
$(".cbLinkTwitter").live("click", function(e) {
$.getJSON(cfcRoot + "/twitter.cfc?method=getRequestURL&returnformat=json, {"user_id":user_id}, function(res,code) {
openWindow(res);
});
e.preventDefault();
});
This is all working fine. However after the user grants authorisation, how to I use jQuery to capture the returned tokens. It needs to return to a specified callback URL, but I would like it to return the data silently if possible. Could this be done with an iframe?
I'm probably asking too much, but if anyone's done anything similar, I'd really appreciate a shove in the right direction.