Cross Origin Authentication
Configuration
webauthn:
allowed_origins:
- 'https://acme.com'
- 'https://acme.fr'
- 'android:apk-key-hash://your-app-hash'
- 'ios:bundle-id://your.bundle.id'
allow_subdomains: trueTop Origin Validation (Cross-Origin iframes)
<?php
declare(strict_types=1);
namespace App\Security;
use Webauthn\CeremonyStep\TopOriginValidator;
use Webauthn\Exception\AuthenticatorResponseVerificationException;
final readonly class MyTopOriginValidator implements TopOriginValidator
{
public function validate(string $topOrigin): void
{
$allowed = [
'https://app.example.com',
'https://dashboard.example.com',
];
if (!in_array($topOrigin, $allowed, true)) {
throw AuthenticatorResponseVerificationException::create(
'The top origin is not allowed.'
);
}
}
}Allowed Origins Endpoint
Last updated
Was this helpful?