开发者社区> 问答> 正文

求助: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服务器上配置某些参数?

展开
收起
kun坤 2020-06-08 12:11:19 935 0
1 条回答
写回答
取消 提交回答
  • 都告诉你了: 用户名或密码错误导致的认证失败######

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

    都告诉你了: 用户名或密码错误导致的认证失败 谢谢你,昨晚看了一下后台log,登录错误确实是返回这个异常

    2015.01.20 20:20:18 org.jivesoftware.openfire.net.SASLAuthentication - User Login Failed. PLAIN authentication failed for: ***

    2020-06-08 12:11:25
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

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