Commit 156fae3d authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(webauthn) Fix column headers and domain

issue #6013
parent 8ea045cb
......@@ -27,6 +27,13 @@ class WebauthnRegistrationsAttribute extends OrderedArrayAttribute
$this->edit_enabled = FALSE;
$this->attribute = FALSE;
$this->order = FALSE;
$this->setHeaders([
_('Issuer'),
_('Subject'),
_('Signature count'),
_('Domain'),
'',
]);
}
function addRegistration (string $value)
......@@ -39,14 +46,9 @@ class WebauthnRegistrationsAttribute extends OrderedArrayAttribute
{
$data = json_decode($json, TRUE);
return [
//~ $data['credentialId'],
//~ print_r($data['credentialPublicKey'], TRUE),
//~ print_r($data['certificateChain'], TRUE),
//~ print_r($data['certificate'], TRUE),
$data['certificateIssuer'],
$data['certificateSubject'],
($data['signatureCounter'] ?? 0),
//~ print_r($data['AAGUID'], TRUE),
$data['rpId'],
];
}
......
......@@ -111,7 +111,12 @@ class webauthnAccount extends simplePlugin
// new Instance of the server library.
// make sure that $rpId is the domain name.
$WebAuthn = new \WebAuthn\WebAuthn('WebAuthn Library', 'localhost', $formats);
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
} else {
$host = $_SERVER['SERVER_NAME'];
}
$WebAuthn = new \WebAuthn\WebAuthn('FusionDirectory', $host, $formats);
// add root certificates to validate new registrations
/*if ($_GET['solo']) {
......
  • SonarQube analysis reported 11 issues

    • 10 major
    • 1 info

    Top 10 extra issues

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. Remove this commented out code. 📘
    2. Remove this commented out code. 📘
    3. Remove this commented out code. 📘
    4. Remove this commented out code. 📘
    5. Remove this commented out code. 📘
    6. Remove this commented out code. 📘
    7. Remove this commented out code. 📘
    8. Remove this commented out code. 📘
    9. Remove this commented out code. 📘
    10. Remove this commented out code. 📘
    • ... 1 more
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment