[英]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.