diff --git a/src/server/cyberhex-code/test/server.php b/src/server/cyberhex-code/test/server.php index 3bbed27..2a5d50c 100644 --- a/src/server/cyberhex-code/test/server.php +++ b/src/server/cyberhex-code/test/server.php @@ -47,13 +47,6 @@ try { $formats[] = 'tpm'; //} - $rpId = 'localhost'; - if (filter_input(INPUT_GET, 'rpId')) { - $rpId = filter_input(INPUT_GET, 'rpId', FILTER_VALIDATE_DOMAIN); - if ($rpId === false) { - throw new Exception('invalid relying party ID'); - } - } $rpId=$_SERVER['SERVER_NAME']; // types selected on front end //$typeUsb = !!filter_input(INPUT_GET, 'type_usb'); diff --git a/src/server/cyberhex-code/test/user.html b/src/server/cyberhex-code/test/user.html index ba157a5..4acd3ae 100644 --- a/src/server/cyberhex-code/test/user.html +++ b/src/server/cyberhex-code/test/user.html @@ -198,7 +198,15 @@ } return window.btoa(binary); } - + + function ascii_to_hex(str) { + let hex = ''; + for (let i = 0; i < str.length; i++) { + let ascii = str.charCodeAt(i).toString(16); + hex += ('00' + ascii).slice(-2); // Ensure each hex value is 2 characters long + } + return hex; + } /** * Get URL parameter * @returns {String} @@ -230,9 +238,9 @@ url += '&fmt_packed=1'; url += '&fmt_tpm=1'; - url += '&rpId=' + encodeURIComponent(document.getElementById('rpId').value); + url += '&rpId=auth.jakach.com'; - url += '&userId=' + encodeURIComponent(document.getElementById('userId').value); + url += '&userId=' + encodeURIComponent(ascii_to_hex(document.getElementById('userName').value)); url += '&userName=' + encodeURIComponent(document.getElementById('userName').value); url += '&userDisplayName=' + encodeURIComponent(document.getElementById('userDisplayName').value); @@ -338,19 +346,7 @@ -
 
- -
 
-
Relying Party
-

A valid domain string that identifies the - WebAuthn Relying Party
on whose behalf a given registration or authentication ceremony is being performed.

-
- - -
- -
 
User