简体   繁体   中英

xmpp authenticate to face book chat api and always receive a failure

I use the gloox open source API which works again several other XMPP servers. I use the following code

 JID jid( "USERID@chat.facebook.com" );
  j = new Client( jid, "PASSWORD" );
  j->setServer("chat.facebook.com");
  j->setPort(5222);
  j->setSASLMechanisms(gloox::SaslMechPlain);
  j->setTls(gloox::TLSPolicy::TLSRequired);

  j->registerConnectionListener( this );
  j->registerMessageSessionHandler( this, 0 );
  j->disco()->setVersion( "messageTest", GLOOX_VERSION, "Windows" );
  j->disco()->setIdentity( "client", "bot" );
  j->disco()->addFeature( XMLNS_CHAT_STATES );
  StringList ca;

It connects and opens the tls socket but always receives a SaslNotAuthorized back from facebook.

Is my userID correct? Am I missing something from facebook?

Any help would be greatly appreciated.

  • Check your Facebook Chat JID here , under "other" link.
  • You no need to change any server, port, SASL or TLS parameters, set up only JID and password, XMPP library should find all other parameters automatically. Just tested with gloox and it works fine.

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