fix profile cannot access while logining from GG account
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
import org.springframework.security.crypto.password.MessageDigestPasswordEncoder;
|
||||
|
||||
public class TestOracleJDBC {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void main(String[] args) {
|
||||
String jdbcUrl = "jdbc:oracle:thin:@192.168.1.15:1521/sisvietnam";
|
||||
String username = "sisvietnam";
|
||||
String password = "sisvietnam";
|
||||
|
||||
try {
|
||||
Connection connection = DriverManager.getConnection(jdbcUrl, username, password);
|
||||
System.out.println("Connection successful!");
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
System.err.println("Connection failed!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
MessageDigestPasswordEncoder encoder = new MessageDigestPasswordEncoder("SHA-256");
|
||||
String hash = encoder.encode("admin");
|
||||
System.out.println("Encoded hash for admin: " + hash);
|
||||
boolean matches = encoder.matches("admin", "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918");
|
||||
System.out.println("Does 'admin' match my hash? " + matches);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user