Facebook JS OAuth Dialog behaves strangely

67 views Asked by At

I am using the Facebook JS SDK v3.2.0 for an OAuth2 authentication. I use the following code:

For initialization:

FB.init({
    appId: 'MY_APP_ID',
    status: true,
    xfbml: true,
    version: 'v1.0'
});

As a (synchronous) response to a user click on a button:

FB.login(function(response) {
    if(response.authResponse) {
        console.log('success');
    } else {
        console.log('error');
    }
});

Behavior:

Initially, the dialog popup opens, asking for the basic permissions. When clicking on the "Okay" button in the dialog, a request to facebook is made which returns with 200. Additionally, when using the FB.getLoginStatus(), I see that I am correctly logged in.

However, neither does the popup close nor is my callback function for the login call evoked.

Moreover, re-trying the whole process will result in a blank popup opening which can be resolved by removing my app manually from my list of authorized apps on Facebook's settings page.

0

There are 0 answers