Open Grahack opened 10 years ago
Plugins existants:
Bout de code qui fonctionne pour authentifier contre un hash Django depuis PHP:
$dbconn = pg_connect("host=postgresql1.alwaysdata.com dbname=tavu user=oubien password=oubienbienoubien"); $result = pg_query($dbconn, "select username, password from auth_user where username='$user';"); if ($result) { $result_array = pg_fetch_array($result, 0); $pbkdf_hash = $result_array['password']; } else { echo "pas de resultat"; } pg_close($dbconn); $pieces = explode('$', $pbkdf_hash); $iterations = $pieces[1]; $salt = $pieces[2]; $stored_hash = $pieces[3]; $recalculated = base64_encode(hash_pbkdf2("sha256", $pass, $salt, $iterations, 32, true)); if ($recalculated == $stored_hash) { echo ("SUCCESS"); } else { echo ("FAILED"); }
Plugins existants:
Bout de code qui fonctionne pour authentifier contre un hash Django depuis PHP: