我在facebook app中使用身份验证时收到安全警告。我的代码与screenShot一起显示,带有安全警告
private void imageFacebook_Tap(object sender, GestureEventArgs e)
{
FaceBookBlocker.Visibility = Visibility.Visible;
pop_up.IsOpen = true;
//Get this from the facebook
string appId = "My Facebook App Id";
var parameters = new Dictionary<string, object>();
parameters["client_id"] = appId;
parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
parameters["response_type"] = "token";
parameters["display"] = "touch";
string extendedPermissions = "user_about_me,read_stream,publish_stream";
// add the 'scope' only if we have extendedPermissions.
if (!string.IsNullOrEmpty(extendedPermissions))
{
// A comma-delimited list of permissions
parameters["scope"] = extendedPermissions;
}
var oauth = new FacebookOAuthClient();
//Create the login url
var loginUrl = oauth.GetLoginUrl(parameters);
////Open the facebook login page into the browser
_webBrowser.Navigate(loginUrl);
}
答案 0 :(得分:1)
我确实已经解决了。请在这里查看我的答案。 Escape from Facebook security Warning
同时将http:
替换为Facebook GraphAPI中的https:
。
答案 1 :(得分:0)
将会有你的代码,你连接到Facebook.Best猜测Facebook会对他们的API进行安全性更改,并且你使用的代码尚未更新以使用新的API
可选地
你需要删除这段代码
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "// connect . facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
看起来它在你的页脚?
答案 2 :(得分:0)
如果导航到成功页面,我只是隐藏BrowserControl
private void BrowserControl_Navigating(object sender, NavigatingEventArgs e)
{
if (e.Uri.AbsolutePath.ToString() == "/connect/login_success.html")
{
BrowserControl.Visibility = Visibility.Collapsed;
}
if (NavigatingCallback != null)
{
NavigatingCallback();
}
}