Twitter @Anywhere Sign in Not Sure How to use Bridge_Code

374 views Asked by At

I have setup an Application that uses @Anywhere from twitter to Authenticate the users. I moved this away from the older way I was doing it of Sending the user to a new tab, logging in to twitter, clicking authorize, and entering the PIN and username into my system because it was too many steps and users were getting confused.

The Problem I have now is I need to store the oauth_token and oauth_token_secret in the database so that I can get their information and associate it with my own userids allowing the user to reply to tweets inside the application.

However I dont get these fields when I make the call back I get an "ouath_access_token" which doesnt look very similar to the ones I was getting before using @Anywhere and also a "oauth_bridge_code"

I have seen some very vague docs on how to use this to get the real data I would like.

I tried doing something like this from a slide I had seen

    $.ajax({
            url:'http://api.twitter.com/oauth/access_token',
            type:'POST',
            data:bridge_code,
            success: function(data, jqXHR){
                         //investigate data returned
                         console.log(data,jqXHR);
                      }
           });

====================EDIT===================

Now I am getting a specific error when sending the above request

  XMLHttpRequest cannot load https://api.twitter.com/oauth/access_token. Origin http://127.0.0.1 is not allowed by Access-Control-Allow-Origin.

  POST https://api.twitter.com/oauth/access_token undefined (undefined)
1

There are 1 answers

0
BillPull On BEST ANSWER