1

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?
Community
  • 1
  • 1
MDe
  • 2,478
  • 3
  • 22
  • 27
  • Do you have all the relevant domain(s) (including local testing domains) in the white list for your app? I got tripped up on this whilst testing on multiple devices. [screenshot](http://puu.sh/dqjl9/8b3c0d0892.png) – Sebastian Grant Dec 11 '14 at 15:51
  • Were you able to solve this? I have the exact same problem at the moment. I'm running this all on localhost. – London804 Dec 22 '14 at 21:41
  • @London804, turned out to be a typo in my domain whitelist, as suggested in the comment above. Doubt that helps you on localhost, but if you have any other info, post it and I'll see if I can help! – MDe Dec 24 '14 at 13:45

1 Answers1

2

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.

jdiver
  • 233
  • 1
  • 3
  • 10
  • 1
    It appears that the URL may have changed. I was able to click "remove app" by clicking on the "Settings" button towards the top-right of the Apps table. – j.raymond Sep 10 '15 at 17:46
  • @jdiver I am also using this as a login mechanism, but it does not work. How would that be fixed? – meow Feb 14 '17 at 22:41