This demo project shows the handling of the user creation with a custom encrypted password.
Clone the GIT Reporsitory or use the import function of RapiClipse.
File -> Import -> RapidClipse -> Demo Projects -> "rapidclipse-demo-user-creation"
- Sometimes you can fix project errors by running a Maven update. "Right click on the project" > "Maven" > "Update Project".
- Connect to your H2 Northwind database with the "Data Source Explorer" view in RapidClipse.
- Open the schema.ddl file and export the script to your H2 Northwind database. The DDL file is located under "res/ddl/schema.ddl". See "Run DDL scripts"
- Now you can run the application with the "Start UI" function in the "Quick Launch" view.
see 'MainView'
final String password = this.txtPassword.getValue();
//You can choose between SHA2, SHA1, MD5 or PBKDF2WithHmacSHA1.
final byte[] firstPassword = new HashStrategy.SHA2().hashPassword(password.getBytes());
see 'MainView'
final byte[] firstPassword = new HashStrategy.SHA2().hashPassword(password.getBytes());
final byte[] secondPassword = new HashStrategy.SHA2().hashPassword(password2.getBytes());
if(Arrays.equals(firstPassword, secondPassword))
{
//...
}