(서버 측 흐름 사용) 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());
}
}
}