角+ Facebook的JS SDK登录:不要求我的权限 [英] Angular + Facebook JS SDK login: Not requesting my permissions

查看:153
本文介绍了角+ Facebook的JS SDK登录:不要求我的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FB.login()不工作。该FB弹出未请求正确的权限。我可以清楚地看到,在源$ C ​​$ C,它有使用权的参数FN处理器/正确设置参数。我想知道为什么是不是这方面的工作?

FB.login() is not working. The FB Popup is not requesting the right permissions. I can clearly see, in the source code that there's a fn handler that uses the right parameters / parameters being set correctly. I'd like to understand why isn't this working ?

这是code到目前为止,我已经得到了:

This is the code I've got so far:

http://jsbin.com/IteY/1/

这是我设置的权限列表:

This is where I'm setting the permissions list:

facebook.login(function(response) {
    console.log(response);
}, {scope: 'email,user_likes'});

按照文档( https://developers.facebook.com /docs/reference/javascript/FB.login/

由FN处理程序做的console.log进行登录(),我得到的Fn功能(响应){...}和{范围:电子邮件,user_likes'}

by doing console.log in the fn handler for login(), I get the fn function(response){ ... } and the {scope: 'email,user_likes'}

我发现了一些其他用户在这里使用FB SDK中SO报告了同样的问题。我试着使用烫发,而不是范围一角,但我得到:

I found some other users reporting the same issue using the FB SDK here in SO. I tried the tip to use "perms" instead of "scope", but I get:

的OAuth2规范规定,烫发现在应该称为范围。请更新。

OAuth2 specification states that 'perms' should now be called 'scope'. Please update.


  • 没有出现是问题。这也表明,参数正在被发送那里。去难怪为什么不工作?!我已经清理缓存太

  • Not appearing to be the problem. This also shows that the param is being send there. Go wonder why's not working ?! I've cleaned cache too

本来我报道这个问题(<一个href=\"http://stackoverflow.com/questions/18400769/angularjs-di-error-no-module-facebook-why-isnt-working\">AngularJS: DI错误 - 无模块:$脸谱,为什么不工作),这是解决了吗?。现在有机会获得到FB对象,我不能够从用户那里得到正确的权限。我敢肯定,这是与Facebook的API,而不是角模块

Originally I've reported this issue (AngularJS: DI Error - No module: $facebook, why isn't working?) that was solved. Now having access to the FB object I'm not able to get the right permissions from the user. I'm sure that this is an issue related with Facebook API and not the Angular module

*的 * 的我也试过用.API像检查的权限:

** I've also tried to check the permissions by using .api like :

facebook.api('/me/permissions', function (response) {
    console.log(response);
} );

的console.log报告:

console.log reports:

{对象错误:对象}

Object {error: Object}

* 现在,我已经尝试使用的access_token通过图形来访问:

* Now I've tried to access through the graph using the access_token:

https://graph.facebook.com/me/permissions?access_token=XXXXXXXX

和我可以看到正确的权限,但Facebook登录弹出从来没有问过我有关吗? 不应该吗?

and I can see the right permissions, but the Facebook login popup never asked me about them ? Shouldn't it ?

  {
     "data": [
        {
           "installed": 1,
           "basic_info": 1,
           "email": 1,
           "read_friendlists": 1,
           "user_likes": 1,
           "user_online_presence": 1,
           "user_friends": 1
        }
     ],
     "paging": {
        "next": "xxxxxxx"
     }
  }

我现在已经问了一个不同的用户,谁我已经添加到我的沙箱作为管理员,他得到了所需的权限弹出!所以,我认为是值得做的,用我自己的用户名谁了这个权限已经设置什么 - 即使我试图删除缓存,等等

I've now asked a different user, who I've added to my sandbox as an admin and he got the required permissions popup! So, I think is something to do, with my own username who had this permissions already set or something - even though I tried to delete the cache, etc!

那么,有没有问题要解决。希望这是有人在别的将来有用!

So, there's no issue to solve. Hope this is useful for someone else in the future!

任何一个有经验可以看看?

Any one experienced can take a look ?

感谢您

推荐答案

尝试监听器连接到Facebook的登录事件/ statuschange:

Try attaching a listener to the facebook login event / statuschange:

$facebookProvider.Event.subscribe('auth.authResponseChange', function (response) {
    console.log(response);
})

和看响应元素,看看是否有错误或不

And look at the response element to see if you have an error or not

这篇关于角+ Facebook的JS SDK登录:不要求我的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆