简体   繁体   English

用户的Facebook扩展许可授予

[英]Facebook extended permission grant by user

How to know if user has granted extended permission requested by application. 如何知道用户是否已授予应用程序请求的扩展权限。 I use java at back end, and login and facebook registration is handled by socialauth api. 我在后端使用Java,而登录和Facebook注册则由socialauth api处理。 I want to publish feed to user's timeline. 我想将提要发布到用户的时间轴。 Javascript is unable to hit the url because it doesn't have access token for facebook communication. Javascript无法访问该网址,因为它没有用于Facebook通信的访问令牌。 Can this thing be done without using any client facebook java api? 可以在不使用任何客户端facebook java api的情况下完成此操作吗?

通过您喜欢的方式从Graph API获取/ me / permissions

In your implementation of a SignInAdapter, use the Connection object injected into the signIn(...) method to generate a facebook object and then use can use the userOperations object to get related permissions. 在SignInAdapter的实现中,使用注入到signIn(...)方法中的Connection对象生成一个facebook对象,然后使用可以使用userOperations对象获取相关权限。 The following code sample can help: 以下代码示例可以帮助您:

    Facebook facebook = (Facebook) connection.getApi();
    facebook.userOperations().getUserPermissions().stream().forEach(x -> log.info("Permission {}: {}", x.getName(), x.getStatus()));

I know this question is old but this answer might help anyone starting out. 我知道这个问题很旧,但是这个答案可能会对任何入门者有所帮助。 This is done based on the assumption that you are using spring-social-facebook. 这是基于您正在使用spring-social-facebook的假设而完成的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM