none
Facebook Login popup not closed after successfull login?

    Pertanyaan

  • Hi,

    I have implemented Facebook integration with sharepoint. My problem is when i click on Face book login the small window will open. when i pass the valid credential it will redirected to URL which i specified in Connect URL in Facebook application on developer.facebook.com. The main problem is this page is redirected on same page (small login page). not in new page. I want that if user logged in then that login window will be closed and main window will be redirected to url

    is there anything missing in library or in javascript?

    Below code I used:

    <script src="https://connect.facebook.net/en_US/all.js" type="text/javascript" charset="utf-8"></script>

    <fb:login-button class="fb-login" onclick="share_prompt()"></fb:login-button>

    <style type="text/css">

    .fb-login
    {
        background: url('http://sstatic.net/ads/img/fb.png?v=5');
        background-position: -107px 0px;
        width: 70px;
        height: 22px;
        float: left;
        top: -1px;
        border: transparent;
        margin-left: 10px;
        margin-top: 19px;
    }
    </style>

    <div id="fb-root"></div> 

    <script>

    function share_prompt() {

    FB.init({
                appId      : '1********',           
                status     : true,
                cookie     : true,
                xfbml      : true,
                oauth      : true,           
              });

    FB.ui({     
     method: 'feed',         
     name: 'Facebook Dialogs',  
     redirect_uri:'http://sp2010sw140:20004/_trust/default.aspx?trust=Facebook&ReturnUrl=%2f_layouts%2fAuthenticate.aspx%3fSource%3d%252FSitePages%252FHome%252Easpx&Source=%2FSitePages%2FHome.aspx',    
            message: ''

          });


    (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));

    FB_RequireFeatures(["Api"], function() {
                    FB.Facebook.init('1*******', 'http://sp2010sw140:20004/_trust/default.aspx?trust=Facebook&ReturnUrl=%2f_layouts%2fAuthenticate.aspx%3fSource%3d%252FSitePages%252FHome%252Easpx&Source=%2FSitePages%2FHome.aspx/xd_receiver.htm', {"reloadIfSessionStateChanged":true});                           
    });
               
    }
     

    </script>

    Thanks in advance

    28 Maret 2012 12:24

Jawaban

  • Please recheck:

    redirect_uri:'http://sp2010sw140:20004/_trust/default.aspx?trust=Facebook&ReturnUrl=%2f_layouts%2fAuthenticate.aspx%3fSource%3d%252FSitePages%252FHome%252Easpx&Source=%2FSitePages%2FHome.aspx',    
            message: ''

    Have you generated any log file or trace file for this code? Please provide it, if you have?

    http://www.dannyjessee.com/blog/index.php/2012/01/beyond-authentication-deeper-facebook-integration-with-sharepoint-with-code/

    http://facebooksdk.codeplex.com/releases/view/78901

    Building server side components that can integrate SharePoint and Facebook have some requirements that you must solve before the integration of other components such as web parts can begin.  Some of the major issues that must be solved are where do I store the Application Key/Secret and how can you maintain user authorization per page.

    http://sharepointguys.com/brendon/social-computing/social-networking/server-side-integration-of-sharepoint-and-facebook/

    30 Maret 2012 5:03