简体   繁体   中英

C# XMPP X-FACEBOOK-PLATFORM SASL implementation

I'm trying to integrate an application with Facebook Chat in C#. Facebook recommends the use of the X-FACEBOOK-PLATFORM SASL mechanism. The documentation describes X-FACEBOOK-PLATFORM requiring the following parameters:

string method // Should be the same as the method specified by the server.
string api_key // The application key associated with the calling application.
string session_key // The session key of the logged in user.
float call_id // The request's sequence number.
string sig // An MD5 hash of the current request and your secret key.
string v // This must be set to 1.0 to use this version of the API.
string format // Optional - Ignored.
string cnonce // Optional - Client-selected nonce. Ignored.
string nonce // Should be the same as the nonce specified by the server.

From this other Stackoverflow Question I was able to understand where the value of the session_key and sig come from, but I am having a hard time finding where the value of call_id is defined. Also in the above mentioned link, the answer has the sig value as being:

string sig = "api_key=" + apiKey
                        + "call_id=" + callId
                        + "method=" + method
                        + "nonce=" + nonce
                        + "session_key=" + sessionKey
                        + "v=" + version
                        + appSecret;

Is there suppose to be anything separating the version and the appSecret? The Facebook documentation doesn't say anything about including the appSecret, is it necessary to add?

Thanks for any help :)

In the post you linked, there was a definition for callId (top line) As for appSecret, try it with and without. If both work, there is your answer!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM