FriendsOfSymfony / FOSFacebookBundle

NOT MAINTAINED - see https://github.com/hwi/HWIOAuthBundle
321 stars 140 forks source link

"An active access token must be used to query information about the current user." #142

Open fabiofabbrucci opened 12 years ago

fabiofabbrucci commented 12 years ago

Hi, i correctly installed FOSFacebookBundle. The login and registration with FB works great! Like in documentation the method of User entity setFBData add role to the user ROLE_FACEBOOK.Great. Then in security.yml I can add the row access_control:

Then, now if I login with facebook and i go to this route it works. But if I login with the same user using fosuserlogin form (so username and password) this route give me the error in the subject. The error comes from this line of code in controller: $this->get('my.facebook.user')->facebook->api('/me/friends');

I found this nice post http://codesauce.com/posts/fosfacebookbundle-canvas-app-authentication/ that explain how to "easily" fix the bug, with a reference to this page "https://developers.facebook.com/blog/post/2011/05/13/how-to--handle-expired-access-tokens/".

Am I doing something wrong? Should I give extrapermission in my FB application?