繁体   English   中英

使用md5哈希密码登录到Openfire

[英]Smack login with md5 hashed password to Openfire

如何使用MD5哈希密码登录openfire?

我正在使用smack 4.0.4。

我已经尝试过DIGEST-MD5注册,但它不起作用

SASLAuthentication.registerSASLMechanism("DIGEST-MD5", SASLDigestMD5Mechanism.class); 
SASLAuthentication.supportSASLMechanism("DIGEST-MD5");

我收到这个错误:

使用PLAIN的SASLError:未经授权

我的代码看起来像这样:

config = new ConnectionConfiguration(xmppServerAddress, Integer.parseInt(xmppServerPort));
config.setDebuggerEnabled(true);
config.setReconnectionAllowed(true);    
config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
XMPPTCPConnection connectionTmp = new XMPPTCPConnection(config);
connectionTmp.connect();

connectionTmp.login("username","md5hashedpassword");

我有类似的问题,你可以检查你的密码是否在md5。

我已经从userid(长类型)生成密码:

@Override
    public String generatePassword(long userId) {
        String userIdString = String.valueOf(userId);
        return MD5util.getMD5(userIdString + StringUtil.getStringAlternateCharacters(userIdString));
    }

或者发现您的xmpp服务器(openfire)IP已正确配置为您要登录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM