【问题标题】:Facebook Chat returns "Not authorized"Facebook 聊天返回“未授权”
【发布时间】:2012-10-24 13:34:35
【问题描述】:

我正在开发一个 Facebook 聊天客户端,我正在使用 QXmpp 连接到聊天服务器。

QString user = ... // This is the Facebook's user id, not the user's email 
QString passwd = ...
QXmppClient *xmppClient = new QXmppClient();
xmppClient->connectToServer(user + "@chat.facebook.com", passwd);

只有少数“随机”用户无法连接。检查我刚刚得到的日志:

vie 12. oct 21:02:58 2012 RECEIVED <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
vie 12. oct 21:03:03 2012 WARNING Authentication failure

【问题讨论】:

  • 我使用 firstname.lastname@chat.facebook.com 登录 facebook 聊天

标签: facebook xmpp chat


【解决方案1】:

问题在于用户名的大小写。 Facebook 允许使用大写字母的用户名,但为了使用 XMPP 连接到 Facebook 聊天,用户名必须规范化为小写。例如:

QString user = ... // This is the Facebook's user id, not the user's email 
QString passwd = ...

QString normUser = user.toLower(); // Normalized username

QXmppClient *xmppClient = new QXmppClient();
xmppClient->connectToServer(normUser + "@chat.facebook.com", passwd);

【讨论】:

    猜你喜欢
    • 2012-06-11
    • 1970-01-01
    • 2013-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多