使用Smack集成Facebook聊天时,SASL身份验证失败

编程入门 行业动态 更新时间:2024-10-28 15:33:44
本文介绍了使用Smack集成Facebook聊天时,SASL身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用smack API集成facebook聊天.但是我收到一条错误消息,提示使用摘要md5验证失败...

I am trying to integrate facebook chat using smack API.But i get an error telling authentication failed using digest md5...

以下是用于验证的代码:

Here s the code for authentication:

SASLAuthentication.registerSASLMechanism("DIGEST-MD5", SASLDigestMD5Mechanism.class); SASLAuthentication.supportSASLMechanism("DIGEST-MD5", 0); ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook",5222); connection = new XMPPConnection(config); config.setSASLAuthenticationEnabled(true); connection.connect(); connection.login(userName, password);

以下是我在运行该错误时遇到的错误:

below is the error i get wen i run it:

Exception in thread "main" SASL authentication failed using mechanism DIGEST-MD5: at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:325) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349) at JabberSmackAPIFacebook.login(JabberSmackAPIFacebook.java:31) at JabberSmackAPIFacebook.main(JabberSmackAPIFacebook.java:77)

我可以成功连接到gtalk,但是没有成功vit fb ... 可以打电话给我解决问题

I can successfully connect to gtalk but am having no success vit fb... can sumone tel me wat s the problem

推荐答案

对我来说,解决方案是在不使用DNS SRV调用login()时不在主机名中包含主机部分. Google Talk服务.这也是论坛中所述的.

For me the solution was to not include the host part in the username when calling login() without DNS SRV and not agains the Google Talk services. This is also described in the ignite forums.

例如

connection.login("user@jabber", "password", "resource");

成为

connection.login("user", "password", "resource");

更多推荐

使用Smack集成Facebook聊天时,SASL身份验证失败

本文发布于:2023-10-13 00:40:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486321.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   Smack   Facebook   SASL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!