开发者

Facebook logs me out after authentication via oauth on external site

just to recap the process:

  1. I call https//graph.facebook.com/oauth/authorize?client_id=.. to get a code.

  2. This redirects the user to the facebook login page. They login. A FB session is created in their browser.

  3. The browser redirects to http//www.mysite.com/connect/callback?code=..

  4. I take that code and exchange it for a token: https//graph.facebook.com/oauth/access … ent_id=...

  5. I use that token to call the Graph and REST APIs, doing stuff on the users behalf like querying on me.

To clarify, I know the token works as I can request information on /me.

My problem is that when I access facebook.com in another tab, I get told that I need to log in and it kicks me out.

I've added in functionality to curl to save cookies and I get:

# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.

.facebook.com   TRUE    /       FALSE   1134567810      datr    1121456789-111cabef6e8b649338941b9ab289739a38803ec932211a0bec3ee8

Is this correct? Is there anything more that should be there?

开发者_如何学C

Should I be able to authenticate to FB with my external site and then access FB without getting kicked out?

Thanks for any help, I will appreciate it.


Ignore this, as I was always using 1 tab for the facebook page and refreshing it. Apparently theres something in the links of facebook that carry session data. Once I started closing the link when I logged out of facebook and then opening either a new window or tab and then logging into facebook, its fine.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜