Question

If I login in facebook's page Its login in my aplication too; and with logout is the same, if I logout my aplication, its logout facebook.

Does exist an option to avoid that when Logged into Facebook connected with my application and vice versa?

This is the code:

    <fb:login-button autologoutlink="true" perms="email"></fb:login-button>

    <script>
        window.fbAsyncInit = function() {
            FB.init({
            appId : 'xxxx',
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            xfbml      : true  // parse XFBML
        }); 

        //  LogIn data retrieval            
         FB.Event.subscribe('auth.login', function(response) {
            var nameFB;
            var emailFB;
            var accessToken;
            FB.api('/me', function(response) {

                nameFB = response.name;
                emailFB = response.email;
                FB.getLoginStatus(function(response) {
                    if (response.status === 'connected') {
                        var uid = response.authResponse.userID;
                        accessToken = response.authResponse.accessToken;

                    } else if (response.status === 'not_authorized') {
                    } else {}
                });

                facebookData(nameFB, emailFB, accessToken);                                             
            });

        }, {scope: 'email'});   

    };

    // Load the SDK Asynchronously
    (function(d){
        var js, id = 'facebook-jssdk'; 
        if (d.getElementById(id)) {return;}
        js = d.createElement('script'); 
        js.id = id; 
        js.async = true;
        js.src = "http://connect.facebook.net/es_LA/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
    }(document));

    </script>
Was it helpful?

Solution

If you are using Facebook as the sole arbitrator for your authentication system, no.

To do what you want, you'd have to create a shadow account for them on your site, and then when they're logged in to Facebook and come to your site, you also authenticate them there. That way even if they re logged out of Facebook they can use your site. Or they can log out of your site and still use Facebook.

But if the only authentication/authorization system you're using is the Facebook login, then no. You have to be logged into Facebook to use your site.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top