Debugging
PSR-3 Logger Integration
Setting Up a Logger
<?php
declare(strict_types=1);
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Psr\Log\LogLevel;
use Webauthn\AuthenticatorAttestationResponseValidator;
use Webauthn\AuthenticatorAssertionResponseValidator;
// Create a PSR-3 logger (using Monolog as example)
$logger = new Logger('webauthn');
$logger->pushHandler(new StreamHandler('path/to/webauthn.log', LogLevel::DEBUG));
// Inject logger into validators
$attestationValidator = AuthenticatorAttestationResponseValidator::create($creationCSM);
$attestationValidator->setLogger($logger);
$assertionValidator = AuthenticatorAssertionResponseValidator::create($requestCSM);
$assertionValidator->setLogger($logger);What Gets Logged
Registration (Attestation) Events
Authentication (Assertion) Events
Log Levels
Example Log Output
Development vs Production
Development Environment
Production Environment
Common Issues and Log Messages
"Challenge mismatch"
"Signature verification failed"
"Origin mismatch"
"User not present" or "User not verified"
Additional Debugging Tools
Browser Developer Tools
Network Inspector
Test Authenticators
See Also
Last updated
Was this helpful?