Java Reference
In-Depth Information
public class Hash {
public static void main(String[] args)
throws Exception{
String password = args[0];
MessageDigest md = null;
md = MessageDigest.getInstance("MD5");
byte[] passwordBytes =
password.getBytes();
byte[] hash = md.digest(passwordBytes);
String passwordHash =
org.jboss.security.Base64Utils.tob64(hash);
System.out.println("password hash:
"+passwordHash);
}
Running the main program with admin as the argument will generate the hash
X8oyfUbUbfqE9IWvAW1/3 . This hash will be your updated password, which needs
to be updated in your database as shown in the following screenshot.
UPDATE USERS SET PASSWD = 'X8oyfUbUbfqE9IWvAW1/
3' WHERE LOGIN = 'admin';
You can update it from any SQL client of your liking.
Using the Database login module in your application
Once you are done with the login module configuration, don't forget to reference it
through the JBoss web deployment's descriptor, WEB-INF/jboss-web.xml .
Search WWH ::




Custom Search