Andrew
Well-known member
Hello!
I am trying to authenticate user credentials against my XF database. I am using the https://github.com/patrickfav/bcrypt library in java to check the secret key stored in the database. However my tests are failing.
Here is the code:
A few question:
I am trying to authenticate user credentials against my XF database. I am using the https://github.com/patrickfav/bcrypt library in java to check the secret key stored in the database. However my tests are failing.
Here is the code:
Java:
public static void main(String[] args) {
// Testing Bcrypt:
// Xf Secret key (from XF database): 394c395363326f4c543173595f676d4a63786341446236523376494346704a67
String password = "abc123";
String version = "$2a$10$";
String secretKey = "394c395363326f4c543173595f676d4a63786341446236523376494346704a67";
BCrypt.Result result = verifyer().verify(password.toCharArray(), version + secretKey);
if (result.verified) {
System.out.println("success");
} else {
System.out.println("fail");
}
}
A few question:
- In order for this to work, can the Java server program and the website exist on separate machines? XF is on HostGator and the Java program is on an array of dedicated server machines.
- Is this
$2a$10$
version and strength identifier correct for a default XF installation (PHP version 5.4.45)?
Last edited: