OAuth.io popup window closing immediately

2.6k views Asked by At

I'm using oauth.io to handle authorization of users' Twitter accounts to pull data from the Twitter API. I use the code exactly as in the demo, inserting my public key and using 'twitter' as the provider:

OAuth.initialize('key'); //OAuth.io public key
    OAuth.popup('twitter')
    .done(function (result) {
        // Perform API calls
        console.log(result);
    })
    .fail(function (error) {
        // Handle errors
    });

When I open the page, a popup window opens, but then closes immediately before I can see anything or diagnose what's going wrong.

I read this answer but it didn't seem to address the issue of the popup closing, just that the author needed to include jQuery, which I've already done.

Questions:

  1. Is there anything I might have done wrong in configuring or setting up my apps, either on oauth.io or Twitter?
  2. Is there a way to diagnose what's happening in the popup between when it opens and closes?
1

There are 1 answers

2
jdiver On

You'll see this exact behavior if you've already granted access to the Facebook app. To remove access for the app and test again, follow these steps:

  • When logged in to your FB account, go to https://www.facebook.com/bookmarks/apps.
  • Click the gear icon next to the app in question.
  • Click "Remove App", then confirm by clicking "Remove" on the resulting confirmation dialog.

Test the oauth.io integration again, and you should see the expected login and/or authorization popup dialogs.