socialsignin / spring-social-security-demo

Spring Social Security Demo - using the default user local account persistence of Spring-Social-Security
23 stars 23 forks source link

'read_stream' permission #7

Open marekslim opened 10 years ago

marekslim commented 10 years ago

When I have the code:
... @Autowired private Facebook facebook;

@RequestMapping(value = "/buttonClick") public String facebook() { FacebookProfile facebookProfile = facebook.userOperations().getUserProfile(); //WORKS (and return proper data) List list = facebook.friendOperations().getFriendProfiles(); //WORKS (and return proper data) facebook.feedOperations().getHomeFeed(); //EXCEPTION ... } When I call this method I have an Exception: HTTP Status 500 - Request processing failed; nested exception is org.springframework.social.InsufficientPermissionException: The operation requires 'read_stream' permission.

My facebook app is configured like that: AppDetails -> Configure App Center Permissions: screen shot 2014-05-13 at 15 49 38

Where should I define the 'read_stream' permission ? What do I do wrong ?

michaellavelle commented 10 years ago

Hi

You should be able to add read_stream permission by adding the following hidden form field to the facebook submit forms in oauthlogin.jsp and oauthconnect.jsp

<input type="hidden" name="scope" value="read_stream" />

Hope this helps, Cheers, Michael

marekslim commented 10 years ago

I tried it before: <form class="login"action="http://localhost:8080/connect/facebook&quot; method="POST">
<input type="hidden" name="scope" value="read_stream" />
<p><input type="submit" value="Connect with Facebook" /></p>
</form> I have the same exception.

I discovered that in the page: https://developers.facebook.com/apps/{YOUR_APP_ID}review-status/ you can apply to use "read_stream" permission. I did it some days ago, but I am waiting for Facebook to approve it. Can it be the reason of my problem ?

ghost commented 9 years ago

public_profile