开发者

Issue with Facebook JS API, revokeAuthorization

开发者 https://www.devze.com 2022-12-26 19:51 出处:网络
I am trying to integ开发者_JAVA百科rate FB connect into our user profile screen.Although, I\'m having an issue with FB.ApiClient.revokeAuthorization.

I am trying to integ开发者_JAVA百科rate FB connect into our user profile screen. Although, I'm having an issue with FB.ApiClient.revokeAuthorization.

http://pastie.org/921942

The basic problem is that I revoke the auth at line 44 after the user clicks the disconnect button.

After that, all subsequent API calls don't have a valid session to even check user status. I've tried wrapping blocks in a FB.Connect.forceSessionRefresh block, but then the code will never be called at all.

I'm not sure what the proper workflow should be for this purpose. Right now it's basically...

  1. User arrives at profile NOT connected to the application.
  2. User clicks on the connect button.
  3. Once connected, DOM manipulation occurs to hide the connect button and add in a disconnect button.
  4. User clicks on the disconnect button.
  5. User's authorization to the application is revoked and (it seems) the API session to the FB server is invalidated.
  6. DOM manipulation occurs to hide the disconnect button and readd the connect button.
  7. User clicks on the connect button.
  8. Once connected, the FB.Connect.get_loggedInUser() doesn't return the actual user.


why not just use the facebook api of $facebook->logout(). By placing $facebook->logout() it will either display the "LOGOUT" button if they are logged in, or show the login button if they are logged out.

Another option is to use the FB JS library and do an onClick event of FB.logout(function(response){ window.location = 'redirecturl'});

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号