From ccf091a7e31bdd07fcc54c2157ff668a7c3f485c Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Sun, 5 Feb 2023 01:21:08 +0100 Subject: [PATCH] log communication in debug mode --- src/Application/Controller/Admin/d3user_webauthn.php | 2 ++ src/Application/Controller/Admin/d3webauthnadminlogin.php | 2 ++ src/Application/Controller/d3_account_webauthn.php | 5 ++++- src/Application/Controller/d3webauthnlogin.php | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Application/Controller/Admin/d3user_webauthn.php b/src/Application/Controller/Admin/d3user_webauthn.php index cfddf64..f5f4b25 100755 --- a/src/Application/Controller/Admin/d3user_webauthn.php +++ b/src/Application/Controller/Admin/d3user_webauthn.php @@ -100,6 +100,7 @@ class d3user_webauthn extends AdminDetailsController try { $error = Registry::getRequest()->getRequestEscapedParameter('error'); if (strlen((string) $error)) { + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug($error); /** @var WebauthnCreateException $e */ $e = oxNew(WebauthnCreateException::class, $error); throw $e; @@ -107,6 +108,7 @@ class d3user_webauthn extends AdminDetailsController $credential = Registry::getRequest()->getRequestEscapedParameter('credential'); if (strlen((string) $credential)) { + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug($credential); /** @var Webauthn $webauthn */ $webauthn = d3GetOxidDIC()->get(Webauthn::class); $webauthn->saveAuthn($credential, Registry::getRequest()->getRequestEscapedParameter('keyname')); diff --git a/src/Application/Controller/Admin/d3webauthnadminlogin.php b/src/Application/Controller/Admin/d3webauthnadminlogin.php index 83a1650..b44e342 100755 --- a/src/Application/Controller/Admin/d3webauthnadminlogin.php +++ b/src/Application/Controller/Admin/d3webauthnadminlogin.php @@ -26,6 +26,7 @@ use Doctrine\DBAL\Driver\Exception as DoctrineDriverException; use Doctrine\DBAL\Exception as DoctrineException; use OxidEsales\Eshop\Application\Controller\Admin\AdminController; use OxidEsales\Eshop\Application\Controller\FrontendController; +use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Request; use OxidEsales\Eshop\Core\Routing\ControllerClassNameResolver; use OxidEsales\Eshop\Core\Session; @@ -101,6 +102,7 @@ class d3webauthnadminlogin extends AdminController $publicKeyCredentialRequestOptions = $webauthn->getRequestOptions($userId); d3GetOxidDIC()->get('d3ox.webauthn.'.Session::class) ->setVariable(WebauthnConf::WEBAUTHN_ADMIN_LOGIN_OBJECT, $publicKeyCredentialRequestOptions); + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug($publicKeyCredentialRequestOptions); $this->addTplParam('webauthn_publickey_login', $publicKeyCredentialRequestOptions); $this->addTplParam('isAdmin', isAdmin()); } catch (WebauthnException $e) { diff --git a/src/Application/Controller/d3_account_webauthn.php b/src/Application/Controller/d3_account_webauthn.php index 5239669..af4d5f9 100755 --- a/src/Application/Controller/d3_account_webauthn.php +++ b/src/Application/Controller/d3_account_webauthn.php @@ -110,6 +110,8 @@ class d3_account_webauthn extends AccountController $publicKeyCredentialCreationOptions = d3GetOxidDIC()->get(Webauthn::class) ->getCreationOptions($this->getUser()); + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug((string) $publicKeyCredentialCreationOptions); + $this->addTplParam('webauthn_publickey_create', $publicKeyCredentialCreationOptions); $this->addTplParam('isAdmin', isAdmin()); $this->addTplParam('keyname', Registry::getRequest()->getRequestEscapedParameter('credenialname')); @@ -127,8 +129,8 @@ class d3_account_webauthn extends AccountController /** @var Request $request */ $request = d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class); $error = $request->getRequestEscapedParameter('error'); - if (strlen((string) $error)) { + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug($error); /** @var WebauthnCreateException $e */ $e = oxNew(WebauthnCreateException::class, $error); throw $e; @@ -136,6 +138,7 @@ class d3_account_webauthn extends AccountController $credential = d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class)->getRequestEscapedParameter('credential'); if (strlen((string) $credential)) { + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug($credential); $webauthn = d3GetOxidDIC()->get(Webauthn::class); $webauthn->saveAuthn($credential, d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class)->getRequestEscapedParameter('keyname')); } diff --git a/src/Application/Controller/d3webauthnlogin.php b/src/Application/Controller/d3webauthnlogin.php index 2c242a2..f367a1a 100755 --- a/src/Application/Controller/d3webauthnlogin.php +++ b/src/Application/Controller/d3webauthnlogin.php @@ -93,6 +93,7 @@ class d3webauthnlogin extends FrontendController /** @var Webauthn $webauthn */ $webauthn = d3GetOxidDIC()->get(Webauthn::class); $publicKeyCredentialRequestOptions = $webauthn->getRequestOptions($userId); + d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)->debug($publicKeyCredentialRequestOptions); $this->addTplParam('webauthn_publickey_login', $publicKeyCredentialRequestOptions); $this->addTplParam('isAdmin', isAdmin()); } catch (WebauthnException $e) {