bug 8313: LDAP connector tested with ApacheDS

This commit is contained in:
Abhinandan Prateek 2011-12-05 11:51:21 +05:30
parent e365e64afe
commit 1dee569f0e
4 changed files with 10 additions and 8 deletions

View File

@ -68,7 +68,7 @@
</adapters>
<adapters key="com.cloud.server.auth.UserAuthenticator">
<adapter name="MD5" class="com.cloud.server.auth.MD5UserAuthenticator"/>
<!-- adapter name="LDAP" class="com.cloud.server.auth.LDAPUserAuthenticator" -->
<adapter name="LDAP" class="com.cloud.server.auth.LDAPUserAuthenticator"/>
</adapters>
<adapters key="com.cloud.ha.Investigator">
<adapter name="SimpleInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator"/>

View File

@ -18,6 +18,9 @@
package com.cloud.server.auth;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
import javax.ejb.Local;
@ -29,6 +32,7 @@ import com.cloud.server.ManagementServer;
import com.cloud.user.UserAccount;
import com.cloud.user.dao.UserAccountDao;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.utils.exception.CloudRuntimeException;
/**
* Simple UserAuthenticator that performs a MD5 hash of the password before
@ -52,8 +56,7 @@ public class MD5UserAuthenticator extends DefaultUserAuthenticator {
s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
return false;
}
/*
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
@ -70,14 +73,13 @@ public class MD5UserAuthenticator extends DefaultUserAuthenticator {
for (int i = 0; i < padding; i++) {
sb.append('0');
}
sb.append(pwStr);
*/
sb.append(pwStr);
// Will: The MD5Authenticator is now a straight pass-through comparison of the
// the passwords because we will not assume that the password passed in has
// already been MD5 hashed. I am keeping the above code in case this requirement changes
// or people need examples of how to MD5 hash passwords in java.
if (!user.getPassword().equals(password)) {
if (!user.getPassword().equals(sb.toString())) {
s_logger.debug("Password does not match");
return false;
}

View File

@ -16,7 +16,7 @@
*
*/
// Default password is MD5 hashed. Set the following variable to false to disable this.
var md5Hashed = true;
var md5Hashed = false;
$(document).ready(function() {
function initUI() {

View File

@ -22,7 +22,7 @@ var ERROR_INTERNET_CANNOT_CONNECT = 12029;
var ERROR_VMOPS_ACCOUNT_ERROR = 531;
// Default password is MD5 hashed. Set the following variable to false to disable this.
var md5Hashed = true;
var md5Hashed = false;
//page size for API call (e.g."listXXXXXXX&pagesize=N" )
var pageSize = 50;