Generate passwords in code
If you must generate passwords in code, the org.jboss.security.Util class provides a static helper method that will hash a password using the specified encoding. String hashedPassword = Util.createPasswordHash("MD5", Util.BASE64_ENCODING, null, null, "password"); OpenSSL provides an alternative way to quickly generate hashed passwords. echo -n password | openssl dgst -md5 -binary | openssl base64 In both cases, the text password should hash to X03MO1qnZdYdgyfeuILPmQ==. This value must be stored in the user store.