From 20ad4aafb763cbec481055be5a9ad9931dd07738 Mon Sep 17 00:00:00 2001 From: Janis Steiner <89935073+jakani24@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:41:43 +0000 Subject: [PATCH] Delete app-code/api/login/create_passkey.php --- app-code/api/login/create_passkey.php | 35 --------------------------- 1 file changed, 35 deletions(-) delete mode 100644 app-code/api/login/create_passkey.php diff --git a/app-code/api/login/create_passkey.php b/app-code/api/login/create_passkey.php deleted file mode 100644 index a19ac95..0000000 --- a/app-code/api/login/create_passkey.php +++ /dev/null @@ -1,35 +0,0 @@ -// registration.php - -session_start(); - -use Webauthn\PublicKeyCredentialCreationOptions; -use Webauthn\PublicKeyCredentialRpEntity; -use Webauthn\PublicKeyCredentialUserEntity; -use Webauthn\AuthenticatorSelectionCriteria; -use Webauthn\AuthenticatorAttestationResponseValidator; - -// Server configuration -$rpEntity = new PublicKeyCredentialRpEntity('Example App', 'example.com'); - -// Fetch or create user -$userId = bin2hex(random_bytes(16)); // Use a unique identifier per user -$_SESSION['user_id'] = $userId; // Save it for verification -$user = new PublicKeyCredentialUserEntity($userId, 'username', 'User Display Name'); - -// Generate options -$options = new PublicKeyCredentialCreationOptions( - $rpEntity, - $user, - random_bytes(16), // Challenge - [ - ['type' => 'public-key', 'alg' => -7], // Algorithms - ], - new AuthenticatorSelectionCriteria(), - PublicKeyCredentialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE -); - -// Save options in session for later verification -$_SESSION['creation_options'] = serialize($options); - -header('Content-Type: application/json'); -echo json_encode($options, JSON_UNESCAPED_SLASHES);