af2efd807d1a4e55e34f766b46705ad5667a66ab
Bernd Wurst merge passkeys feature

Bernd Wurst authored 11 months ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written by schokokeks.org Hosting, namely
6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) This code is published under a 0BSD license.
10) 
11) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
12) */
13) 
14) require_once('passkey.php');
15) require_once('inc/base.php');
16) 
17) require_once('vendor/autoload.php');
18) 
19) $req = filter_input(INPUT_POST, 'req');
20) 
21) // Relying Party == Hostname
22) $rpId = $_SERVER['HTTP_HOST'];
23) 
Bernd Wurst don't require webauthn atte...

Bernd Wurst authored 11 months ago

24) $WebAuthn = new lbuchs\WebAuthn\WebAuthn(config('company_name').' Webinterface', $rpId, ["none"]);
Bernd Wurst merge passkeys feature

Bernd Wurst authored 11 months ago

25) 
26) if ($req == 'getCreateArgs') {
27)     require_role(ROLE_SYSTEMUSER);
28)     $userId = dechex($_SESSION['userinfo']['uid']); // Hex-formatted internal ID not displayed to the user
29)     if (strlen($userId) % 2 == 1) {
30)         $userId = "0".$userId;
31)     }
32)     $userName = $_SESSION['userinfo']['username'];
33)     $_SESSION['passkey_handle'] = filter_input(INPUT_POST, "handle");
34)     $userDisplayName = $_SESSION['userinfo']['name'];
35)     if ($_SESSION['passkey_handle']) {
36)         $userDisplayName = $userDisplayName . " ({$_SESSION['passkey_handle']})";
37)     }
38) 
39)     $requireResidentKey = 'required';
40)     $userVerification = 'preferred';
41)     
Bernd Wurst timeout verlängert

Bernd Wurst authored 11 months ago

42)     $timeout = 3*60;