开发者

Logging into Facebook XMPP with encrypted access token format

Problem with my accessToken!!

accessToken is all right all the time.

It's standard format: AAA|BBB|CCC

I can get available current user's uid and session secret from a given accessToke开发者_开发问答n( AAA|BBB|CCC)

BUT today fb server give me a strange accessToken unexpectedly.It's not useful for xmpplogin.

eg. AAACmERnbMSwBAB3XnOt4hnR71agtbo3CE8w2Xd7jD7QEURSiiOFV1Eg85tHsaHvVNobiUFppqzQcaXKjWOVSZCIFKvVsEJ4llZBfNI6AZDZD

could you give me a clue?I'm crazy to find answers whole day.


As per https://developers.facebook.com/blog/post/572/ the access token format changed recently to an encrypted format. All the APIs should work fine using this encrypted token including XMPP but it requires a minor code change to your XMPP code.

There was a blog post showing how to use the access token for XMPP auth on Sep 10.

Replace the session_key and sig parameters with the access_token parameter which should be the user access_token which has the xmpp_login permission - also note that it needs to be passed over SSL (which I believe was optional when you were only passing only the session key and sig)

If you can't get XMPP login working when you pass the encrypted access token, please file a bug in Facebook's bug tracker, but make sure you have the parameters changed per the note above and the chat docs.


The format of Facebook access token has changed recently. Now it is encrypted. At present if you want to get the user id of the owner of an access token issue a request in the following format

https://graph.facebook.com/me?fields=id&access_token='accesstoken'

This will return the Facebook User id of the owner of access token as a Json string. This request works even when the user is not logged in.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜