on utilise SecretProvider
This commit is contained in:
parent
f4c4dc3294
commit
fc158682cb
@ -5,6 +5,7 @@ import de.mkammerer.argon2.Argon2Factory;
|
||||
|
||||
public class LocalSecretProvider implements SecretProvider {
|
||||
|
||||
// Le mot de passe est "azerty"
|
||||
private final static String ARGON_HASH = "$argon2id$v=19$m=16,t=2,p=1$Tms1dkJYWEZ5OTdJTndVTg$+iBsHiILEshy1JLZsTfZFQ";
|
||||
private final static Argon2 argon2 = Argon2Factory.create(Argon2Factory.Argon2Types.ARGON2id);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
package fr.univ_amu.iut.ui.loginPrompt;
|
||||
|
||||
import fr.univ_amu.iut.secret.SecretProvider;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
@ -24,11 +25,12 @@ public class Controller implements Initializable{
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = event ->{
|
||||
// TODO Use SecretProvider
|
||||
System.out.println(password.getText());
|
||||
if(SecretProvider.getInstance().isSecretValid(password.getText())){
|
||||
System.out.println("Mot de passe OK !");
|
||||
}else{
|
||||
System.out.println("Mot de passe invalide");
|
||||
}
|
||||
};
|
||||
log.setOnAction(handleLogin);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user