Oauth权限请求窗口未使用facebook javascript显示
我正在使用OAuth对话框在应用程序启动时获取用户电子邮件。。。因此,点击应用程序url而不是“允许”窗口时,我会看到一个登录到应用程序窗口的窗口,如果单击“登录”,则会看到一个“允许”窗口。。如何摆脱登录应用程序窗口?代码如下:Oauth权限请求窗口未使用facebook javascript显示,facebook,facebook-graph-api,facebook-javascript-sdk,facebook-oauth,Facebook,Facebook Graph Api,Facebook Javascript Sdk,Facebook Oauth,我正在使用OAuth对话框在应用程序启动时获取用户电子邮件。。。因此,点击应用程序url而不是“允许”窗口时,我会看到一个登录到应用程序窗口的窗口,如果单击“登录”,则会看到一个“允许”窗口。。如何摆脱登录应用程序窗口?代码如下: <script> var href = "https://apps.facebook.com/redirecttestapp/"; var appliId = "233664670032230"; window.fb
<script>
var href = "https://apps.facebook.com/redirecttestapp/";
var appliId = "233664670032230";
window.fbAsyncInit = function() {
FB.init({
appId : '********', // App ID
channelURL : '//apps.facebook.com/redirecttestapp/', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
// Additional initialization code here
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// the user is logged in and connected to your
// app, and response.authResponse supplies
// the user’s ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
alert("the user is logged in and connected to your app");
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
//but not connected to the app
alert("the user is logged in to Facebook,but not connected to the app");
} else {
// the user isn't even logged in to Facebook.
// alert("the user isn't even logged in to Facebook.");
top.location.href = "https://www.facebook.com/dialog/oauth?client_id=233664670032230&redirect_uri="+href+'&display=page';
}
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
var href=”https://apps.facebook.com/redirecttestapp/";
var appliId=“233664670032230”;
window.fbAsyninit=函数(){
FB.init({
appId:“*******”,//应用程序ID
channelURL:“//apps.facebook.com/redirecttestapp/”,//频道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
oauth:true,//启用oauth 2.0
xfbml:true//解析xfbml
});
//这里有额外的初始化代码
FB.getLoginStatus(函数(响应){
如果(response.status===“已连接”){
//用户已登录并连接到您的
//app和response.authResponse提供
//用户ID、有效访问令牌、签名
//请求,以及访问令牌的时间
//和签名的请求都将过期
警报(“用户已登录并连接到您的应用程序”);
var uid=response.authResponse.userID;
var accessToken=response.authResponse.accessToken;
}else if(response.status===“未授权”){
//用户已登录到Facebook,
//但未连接到应用程序
警报(“用户已登录Facebook,但未连接到应用程序”);
}否则{
//该用户甚至没有登录到Facebook。
//警报(“用户甚至没有登录到Facebook。”);
top.location.href=”https://www.facebook.com/dialog/oauth?client_id=233664670032230&redirect_uri=“+href+'&display=page';
}
});
};
//异步加载SDK
(职能(d){
var js,id='facebook jssdk';if(d.getElementById(id)){return;}
js=d.createElement('script');js.id=id;js.async=true;
js.src=“//connect.facebook.net/en_US/all.js”;
d、 getElementsByTagName('head')[0].appendChild(js);
}(文件);
是否启用了“新建身份验证”对话框?
检查你的应用程序设置