From e329c28c3eab93d3894fffa4b1c3686927afbe00 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 21 Nov 2019 22:03:42 +0100 Subject: [PATCH] webauthn --- lam/composer.json | 8 ++++++ lam/lib/webauthn.inc | 49 ++++++++++++++++++++++++++++++++++ lam/templates/lib/500_lam.js | 1 + lam/templates/login2Factor.php | 4 ++- lam/templates/misc/ajax.php | 12 +++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 lam/composer.json create mode 100644 lam/lib/webauthn.inc diff --git a/lam/composer.json b/lam/composer.json new file mode 100644 index 00000000..a78d3bba --- /dev/null +++ b/lam/composer.json @@ -0,0 +1,8 @@ +{ + "config": { + "vendor-dir": "lib/3rdParty/composer" + }, + "require" : { + "web-auth/webauthn-lib" : "2.1.7" + } +} \ No newline at end of file diff --git a/lam/lib/webauthn.inc b/lam/lib/webauthn.inc new file mode 100644 index 00000000..8d105fea --- /dev/null +++ b/lam/lib/webauthn.inc @@ -0,0 +1,49 @@ +getTwoFactorAuthenticationCaption(); diff --git a/lam/templates/misc/ajax.php b/lam/templates/misc/ajax.php index eff89675..09383d35 100644 --- a/lam/templates/misc/ajax.php +++ b/lam/templates/misc/ajax.php @@ -101,6 +101,11 @@ class Ajax { $this->checkPasswordStrength($jsonInput); die(); } + if ($function === 'webauthn') { + enforceUserIsLoggedIn(false); + $this->manageWebauthn(); + die(); + } enforceUserIsLoggedIn(); if ($function == 'passwordChange') { $this->managePasswordChange($jsonInput); @@ -177,6 +182,13 @@ class Ajax { echo json_encode(array("result" => $result)); } + /** + * Manages webauthn requests. + */ + private function manageWebauthn() { + $userDN = $_SESSION['ldap']->getUserName(); + } + /** * Handles DN selection fields. *