开发者社区> 问答> 正文

求助:SASLError using PLAIN: not-authorized?报错

求助:

使用asmack4.06+openfire3.93开发移动IM,遇到一个问题:登录的时候,如果正确输入用户名和密码,则可以正常登录到openfire服务;如果输入的用户名或密码错误,则会报错如下:

org.jivesoftware.smack.sasl.SASLErrorException: SASLError using PLAIN: not-authorized



//连接服务器的代码片段
config = new ConnectionConfiguration(Constants.HOST, Constants.PORT);
config.setSecurityMode(SecurityMode.disabled);
config.setDebuggerEnabled(true);
SASLAuthentication.supportSASLMechanism("PLAIN",0);
connection = new XMPPTCPConnection(config);
connection.connect();

//登录的代码片段
ConServer.getConnection().login(username, password);
ConServer.getConnection().sendPacket(new Presence(Presence.Type.available));



是否需要在openfire服务器上配置某些参数?

展开
收起
爱吃鱼的程序员 2020-06-14 18:18:45 1215 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    都告诉你了:用户名或密码错误导致的认证失败<divclass='ref'>

    引用来自“江安河的鱼”的评论

    都告诉你了:用户名或密码错误导致的认证失败

    2020-06-14 18:19:02
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载