简体   繁体   中英

Facebook login in a web app

I am trying to implement facebook login in my web application. i got the app id and my code is as follows.` My Facebook Login Page

  <div id="fb-root"></div>
  <script>
    window.fbAsyncInit = function() {
      FB.init({
        appId      : '<<App Id>> ', // App ID
        channelUrl : '//www. DOMAIN NAME.com/channel.html', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });
      // Additional initialization code here
    };
    // Load the SDK Asynchronously
    (function(d){
       var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement('script'); js.id = id; js.async = true;
       js.src = "//connect.facebook.net/en_US/all.js";
       ref.parentNode.insertBefore(js, ref);
     }(document));
  </script><div class="fb-login-button"><a href=" ">Login with Facebook</a></div>
</body>

`. I am trying to run this and its giving an error for my app. I also got the secret key but dont know where exactly to place it. Do we need to place any css or js or any other files for this ??

Any help is greatly appreciated..

appId      : '<<App Id>> ', //Place App ID
channelUrl : '//www. DOMAIN0 NAME.com/channel.html', // Place domain here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM