XMPP implemenation in silverlight authentication returs failure

I am trying to implement Xmpp protocol in silverlight and trying to conncet facebook, here i am getting everything correct till <challenge … > obtained from server.

I am using X facebook platform authentication.

I have done this with following code,

byte[] ch = Convert.FromBase64String(message.challenge);

string challenge = System.Text.Encoding.UTF8.GetString(ch, 0, ch.Length);

string response = “”;

long callId = DateTime.UtcNow.Ticks;

MD5 md = new MD5();

String signature1 = “api_key=203366556348506”

  • “call_id=” + callId

  • “method=auth.xmpp_login”

  • param[2]

  • “session_key=” + messageClient.SessionKey

  • “v=1.0”

  • messageClient.AppSecret;

md.Value = signature1;

response = “method=auth.xmpp_login&api_key=203366556348506&session_key=bc6d6e00462cc2bb73a 824bd.4-100001565408667&call_id=” + callId + “&sig=c47d741cb8f18c4e78b990f48e2f63aa&v=1.0&” + param[2];

message.Request = “<response xmlns=“urn:ietf:params:xml:ns:xmpp-sasl”>” + Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(response)) + “”;

this.messageClient.SendMessageAsync(message);

But i am getting following message from server,

Please let me know where i am going wrong.

There is a class named XFacebookPlatform that handles the challenge response.

You can grab the latest code from our nightly builds here: http://www.igniterealtime.org/downloads/nightly_xiff.jsp