简体   繁体   English

使用md5哈希密码登录到Openfire

[英]Smack login with md5 hashed password to Openfire

How can I login with MD5 hashed password to openfire? 如何使用MD5哈希密码登录openfire?

I'm using smack 4.0.4. 我正在使用smack 4.0.4。

I've tried DIGEST-MD5 registiration but it's not work 我已经尝试过DIGEST-MD5注册,但它不起作用

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

I'm getting this error : 我收到这个错误:

SASLError using PLAIN: not-authorized 使用PLAIN的SASLError:未经授权

My code looks like this: 我的代码看起来像这样:

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");

I have a similar problem, you could check if your password is in md5. 我有类似的问题,你可以检查你的密码是否在md5。

I have generate a passwords from the userid (long type) as: 我已经从userid(长类型)生成密码:

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

or find out that your xmpp server (openfire) IP is correctly configured as you wish to login. 或者发现您的xmpp服务器(openfire)IP已正确配置为您要登录。

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

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