Hi all,
I’m trying to implement Facebook chat using Flex and the XIFF library from Ignite Realtime, but running into some issues. I’m following the guidelines in the official doc (terrible): http://developers.facebook.com/docs/chat, and this forum post (good): http://forum.developers.facebook.net/viewtopic.php?pid=209721#p209721.
I implemented the X-FACEBOOK-PLATFORM SASL auth as a class extending XIFF’s SaslAuth. Here’s what my code looks like: http://pastebin.com/A6NbHTt6. However, it doesn’t work! See a sample session at the end of this post.
If anyone could shed some light on what’s going on, it would help me out a lot!
SESSION:
OUT: <?xml version="1.0" encoding="UTF-8"?><stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" to="chat.facebook.com" xml:lang="en" version="1.0"> IN: <?xml version="1.0"?><stream:stream id="C78B06EB" from="chat.facebook.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xml:lang="en"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-FACEBOOK-PLATFORM</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms></stream:features> OUT: <auth mechanism="X-FACEBOOK-PLATFORM" xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/> IN: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dmVyc2lvbj0xJm1ldGhvZD1hdXRoLnhtcHBfbG9naW4mbm9uY2U9N0JGOUNDRTZFODRBNzUzQjgxOUU0MkZBNjRFMzk2MTc=</challenge>
version=1&method=auth.xmpp_login&nonce=7BF9CCE6E84A753B819E42FA64E39617 OUT: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dj0xJTJFMCZtZXRob2Q9YXV0aCUyRXhtcHAlNUZsb2dpbiZzaWc9OTMxYzE0ZjM0MWE4ZTkyOTQ3
MTQyZDM2Zjk3YWQ0JmFwaSU1RmtleT1hYjQ2YTIxMWRiOWVjZWQwNDNlNjJhODUxNjkzOWJmZiZu
b25jZT03QkY5Q0NFNkU4NEE3NTNCODE5RTQyRkE2NEUzOTYxNyZzZXNzaW9uJTVGa2V5PTIlMkU1
UHZJZWRmSk8lNUZwZ09ZM0JmdlB0eWclNUYlNUYlMkUzNjAwJTJFMTI4NDcyMTIwMCUyRDEyMDkw
NTUmY2FsbCU1RmlkPTEyODQ3MTQ0NzY=</response> IN: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>