iframe을 사용하여 asp.net facebook 응용 프로그램을 만들었습니다. 페이지에 사용 권한을 추가 할 때까지 URL http://apps.facebook.com/myappname에 제대로 표시되었습니다. facebook.dll을 사용하여 facebook.Components.FacebookService 클래스를 사용하고이 클래스를 사용하여 인증 토큰 등을 확인했습니다. 응용 프로그램 캔버스 페이지가 비어있는 것처럼 보였습니다. 그러나 캔버스 URL (예 : http://myappname.mydomainname.com)로 사용했던 브라우저 위치 표시 줄에 실제 사이트 URL을 입력하면 사용 권한을 요청하는 응용 프로그램의 프롬프트가 표시됩니다. 누군가 내가 잘못하고있는 곳을 안내해 줄 수 있습니까? 이러한 종류의 문제점으로내 페이 스북 Iframe 응용 프로그램이 빈 캔버스를 표시하는 이유
_fbService.ApplicationKey = FACEBOOK_API_KEY;
_fbService.Secret = FACEBOOK_SECRET;
_fbService.IsDesktopApplication = false;
string sessionKey = Session["Facebook_session_key"] as String;
string userId = Session["Facebook_userId"] as String;
// When the user uses the Facebook login page, the redirect back here
// will will have the auth_token in the query params
authToken = Request.QueryString["auth_token"];
// We have already established a session on behalf of this user
if (!String.IsNullOrEmpty(sessionKey) && !String.IsNullOrEmpty(userId))
{
_fbService.SessionKey = sessionKey;
_fbService.uid = Convert.ToInt64(userId);
}
// This will be executed when Facebook login redirects to our page
else if (!String.IsNullOrEmpty(authToken))
{
try
{
_fbService.CreateSession(authToken);
Session["Facebook_session_key"] = _fbService.SessionKey;
Session["Facebook_userId"] = _fbService.uid;
Session["Facebook_session_expires"] = _fbService.SessionExpires;
}
catch (Exception)
{
Response.Redirect(@"http://www.Facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&v=1.0\");
}
}
// Need to login
else
{
Response.Redirect(@"http://www.Facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&v=1.0\");
}
facebook.Schema.user usr = _fbService.users.getInfo();
//User usr = _fbService.GetUserInfo();
// string t = string.Format("User Name:{0}, Sex:{1}, Location: {2}", usr.first_name, usr.sex, usr.current_location.city);
GetUsersFriendsList();
// GetUserName(usr);
// SetControlVisibility(_fbService.uid.ToString());
}
크롬을 사용하면 X- 프레임 옵션에 의한 표시가 금지되어 있기 때문에 콘솔에서이 오류 만 표시됩니다.> 문서 표시를 거부했습니다. – ria
파이어 폭스 파이어 버그의 경우이 오류> 캐치되지 않은 예외가 표시됨 : 오류 :의 속성이 Proxy.InstallTrigger 속성을 가져 오기위한 권한이 거부되었습니다 ...하지만이 오류를 조사한 일부 장소에서는 firebug 자체는 –
ria
@ria입니다. iFrame이 올바르게 표시되지 않기 때문에 페이지가로드 될 때 Chrome 오류 및 빈 캔버스가 표시되므로 HttpRequest 헤더와 관련이있을 수 있습니다. 이러한 게시물은 다음과 같습니다. http://stackoverflow.com/a/6767901/730133, http://stackoverflow.com/questions/6666423/overcoming-display-forbidden-by-x-frame-options/6767901#6767901 –