2012-01-02 3 views
1

(서버 측 흐름 사용) iframe 내에서 응용 프로그램을 만드는 탭 중 하나를 통해 페이스 북 페이지에 첨부 된 페이스 북 응용 프로그램이 있습니다. 나는 페이스 북의 로고를 클릭하고 앱을 인증 할 때만 액세스 토큰을 얻기 위해 아래의 코드를 사용한다. 내 질문은 어떻게해야합니까 그래서 페이스 북의 로고 물건을 보여주는 대신에 더 나은 사용자 경험을 얻을 수 있습니다. 덕분에 .facebook iframe - 팝업 인증 대신 페이스 북 로고 받기

pageLoad() ON

...... 보호 보이드를 Page_Load (객체 송신자있는 EventArgs E) { 문자열 코드는 Request.QueryString = [ "코드"]; if (HttpContext.Current.Session [ "fbAccessToken"]! = null) { authToken = HttpContext.Current.Session [ "fbAccessToken"] ToString(); }

if (!String.IsNullOrEmpty(authToken)) 
    { 
     thisUserFBID.Value = HttpContext.Current.Session["fbUserId"].ToString(); 
    } 
    else if (code == "" || code == null) 
    { 
     Response.Redirect(appHelp.GetCodeUrl()); 
     //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "shareMe();", true); 
    } 
    else 
    { 
     authToken = appHelp.GetAccessToken(code); 
     Session["access_token"] = authToken; 
     HttpContext.Current.Session["fbAccessToken"] = authToken; 

     try 
     { 
      var fb = new FacebookClient(); 
      fb.AccessToken = authToken; 
      dynamic me = fb.Get("me"); 
      thisUserFBID.Value = (string)me.id; 
      HttpContext.Current.Session["fbUserId"] = thisUserFBID.Value; 
      if (me.locale != null) 
       lang = (string)me.locale; 
      else 
       lang = "en_US"; 
      HttpContext.Current.Session["lang"] = lang; 
     } 
     catch (Exception) 
     { 
      //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "shareMe();", true); 
      //Response.Redirect(appHelp.GetCodeUrl()); 
     } 

    } 
} 

답변

0

허? 사용자가 로그인 한 내용을 사용자에게 알리고 싶지는 않습니까? 나는 혼란스러워. 페이지 탭 응용 프로그램에서 응용 프로그램에 대한 권한을 부여할지 또는 이미 로그인되어 있는지 여부를 묻는 메시지를 표시하여 좋은 정보를 표시 할 수 있습니다. 나는 그것보다 나은 사용자 경험을 만들 수 있을지 모르겠다.