Hi -
I need to import a bunch of users into my environment - does someone have an example XML file for a user import? Or is this even possible...
Thanks
-Josh
Josh,
Do you really want to import users or do you want to integrate with an existing user db? If you're importing them, you'll need to use hashed passwords.
Here's basically what we use to generate them:
public String hash(String password) throws Exception {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(password.getBytes("utf-8"));
return encodeHex(digest.digest());
}
public String encodeHex(byte[] bytes) {
StringBuffer buf = new StringBuffer(bytes.length * 2);
int i;
for (i = 0; i < bytes.length; i++) {
if (((int) bytes+ & 0xff) < 0x10) {
buf.append("0");
}
buf.append(Long.toString((int) bytes+ & 0xff, 16));
}
return buf.toString();
}
So, basically an MD5 hash of the password using utf-8 encoding, which is then converted to hex.
Regards,
Matt
Jive combines collaboration software, community software & social networking software into the leading SBS solution.
© Copyright 2000–2009 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205