SASL authentication failed using mechanism X-FACEBOOK-PLATFORM:

i am working on facebook chat using XMPP protocol. Every time i login i receive an error : SASL authentication failed using mechanism X-FACEBOOK-PLATFORM: here is my code below

private void testLogin() {

ConnectionConfiguration config = new ConnectionConfiguration(

chat.facebook.com”, 5222);

config.setDebuggerEnabled(true);

config.setSASLAuthenticationEnabled(true);

// config.setCompressionEnabled(true);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {

config.setTruststoreType(“AndroidCAStore”);

config.setTruststorePassword(null);

config.setTruststorePath(null);

} else {

config.setTruststoreType(“BKS”);

String path = System.getProperty(“javax.net.ssl.trustStore”);

if (path == null)

path = System.getProperty(“java.home”) + File.separator + “etc”

  • File.separator + “security” + File.separator

  • “cacerts.bks”;

config.setTruststorePath(path);

}

config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);

xmpp = new XMPPConnection(config);

SASLAuthentication.registerSASLMechanism(“X-FACEBOOK-PLATFORM”,

SASLXFacebookPlatformMecha.class);

SASLAuthentication.supportSASLMechanism(“X-FACEBOOK-PLATFORM”, 0);

Log.i(“XMPPClient”, "Access token to " + mFacebook.getAccessToken());

try {

xmpp.connect();

Log.i(“XMPPClient”, "Connected to " + xmpp.getHost());

Thread t = new Thread() {

public void run() {

try {

sleep(3000);

} catch (Exception e) {

e.printStackTrace();

}

}

};

t.start();

} catch (Exception e1) {

Log.i(“XMPPClient”, "Unable to " + xmpp.getHost());

e1.printStackTrace();

}

SASLXFacebookPlatformMecha mech=new SASLXFacebookPlatformMecha(xmpp.getSASLAuthentication());

try {

mech.authenticate(APP_ID,“chat.facebook.com”,mFacebook.getAccessToken());

System.out.println(“Authenticated”);

} catch (Exception ex)

{

ex.printStackTrace();

}

try {

// String APP_ID_new = md5(APP_ID);

// String accesstoken_new = md5(mFacebook.getAccessToken());

xmpp.login(APP_ID, mFacebook.getAccessToken(), “Application”);

Log.i(“XMPPClient”, " its logined ");

System.out.println("xmpp.getUser() " + xmpp.getUser());

} catch (Exception e) {

xmpp.disconnect();

e.printStackTrace();

}

}

I was able to send and receive messages compiling the code as AIR but not as web swf. Were you trying with the browser web plugin?