web-auth / webauthn-framework

FIDO-U2F / FIDO2 / Webauthn Framework
MIT License
423 stars 54 forks source link

How to enable webauthn for a Symfony firewall configured with Symfony ConfigBuilder? #650

Open spackmat opened 1 month ago

spackmat commented 1 month ago

Description

Hi, maybe I'm getting something completely wrong, but I cannot find a way to configure my existing firewall with a ConfigBuilder to use webauthn.

$securityConfig->firewall('main', ['webauthn' => []]); leads to that error: "The following keys are not supported by "Symfony\Config\Security\FirewallConfig": webauthn"

$securityConfig->firewall('main')->webauthn([]) leads to the error "Attempted to call an undefined method named "webauthn" of class "Symfony\Config\Security\FirewallConfig"."

$containerConfigurator->extension('security', ['firewalls' => ['test' => ['webauthn' => []]]]); as a minimal test case works, when no other firewall configs exists.

Configuring via YAML also works as described in https://webauthn-doc.spomky-labs.com/symfony-bundle/firewall But YAML is the only documented config format here.

So any ideas how I can enable the webauthn for my firewall that is configured with a ConfigBuilder?