Search code examples
c#facebookfacebook-loginnopcommercefacebook-authentication

Facebook authentication on Nopcommerce platform


I don't understand the documentation of Nopcommerce.

it seems (in the documentation) that it should be very easy steps - http://docs.nopcommerce.com/display/nc/Facebook+Authentication

I have created Facebook app, I copied and pasted the App ID/API Key and the App Secret to the nopcommerce admin section : "Configure - Facebook Authentication".

I have put this block inside the body tag of the root:

<script>
    window.fbAsyncInit = function () {
        FB.init({
            appId: 'xxxxxxxxxxxxxx',
            cookie: true,
            xfbml: true,
            version: 'v2.2'
        });
    };

    (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) { return; }
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/sdk.js";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

NOW WHAT ???

Where and how should i put the login button?


Solution

  • Facebook authentication doesn't use the JavaScript api. It handles it server side. Follow the steps from the page you linked and those outlined here http://docs.nopcommerce.com/display/nc/External+Authentication++Methods to enable it. If you still can't see the login with Facebook button, maybe your template its not rendering it. Check the login views from the default theme for more information.