Return to Jive Software

This thread is archived
914 Views 2 Replies Last post: Dec 17, 2002 8:44 AM by Matt Tucker RSS
Josh Brose Novice 363 posts since
Nov 25, 2002
Currently Being Moderated

Dec 17, 2002 6:10 AM

XML Import - Users

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

Matt Tucker Jive Employee 3,658 posts since
Jun 28, 2001
Currently Being Moderated
Dec 17, 2002 8:44 AM in response to: Josh Brose
Re: XML Import - Users

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

More Like This

  • Retrieving data ...

Bookmarked By (0)

To better serve our customers we have included functionality to automatically follow up on a case after it has been idle for more than 5 days, and then auto close after an additional 3 days of inactivity. Choose No to acknowledge that this case will remain idle for longer than 5 days.
Making cases public allows other customers to learn from the solution of the case. It can also be used to gain feedback from others in the community. Ask our Support Engineers for more info, but we encourage you to make your cases public.