简体   繁体   中英

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. 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. Can this thing be done without using any client 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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