在Facebook登录中,如何查看用户授予的权限

In Facebook login, how do you see the permissions that the user granted?

本文关键字:用户 权限 何查看 Facebook 登录      更新时间:2023-09-26

截至2011年12月,Facebook更改了他们的API并破坏了每个人的FB.login。以下代码将不再有效:

FB.login(
  function(response) {
    if (response.session) {
      console.info('you logged in');
      if (response.perms) {
        console.info('you granted some permissions');
      }
    }
  }, {
    perms: 'publish_stream'
  }
);

相反,你必须这样做:

FB.login(
  function(response) {
    if (response.authResponse) {
      console.info('you are logged in', response);
    }
  }, {
    scope: 'publish_stream'
  }
);

这至少可以登录,但我再也看不到他们是否接受了我请求的权限。当我注销响应时,它不再包含"perms"密钥:

response: {
  authResponse {    
    accessToken: string,
    expiresIn: number,
    signedRequest: string,
    userID: string
  },
  status
}

不管怎样,它都会说connected。你可能需要查询排列。

据我所知,如果不确认所有请求的权限,用户就无法连接到应用程序。

我承认我可能错了,但作为一名用户和开发人员,我还没有看到这是可能的。