Register Authenticators
Last updated
Was this helpful?
Last updated
Was this helpful?
As described in the previous pages, you need to create a PublicKeyCredentialCreationOptions
object to register new authenticators. You can create this object using the .... But there is another way to do that.
The bundle provides a factory and manages profiles to ease the creation of the options. The factory is available as a public service: Webauthn\Bundle\Service\PublicKeyCredentialCreationOptionsFactory
. To use it, you must first create a least one profile in your configuration file.
The option id is highly recommended. See for acceptable values.
With this profile, now we can create options with the following code lines:
By default, the length of the challenge is 32 bytes. You may need to select a smaller or higher length. This length can be configured for each profile:
The default timeout is set to 60 seconds (60 000 milliseconds). You can change this value as follow:
This option indicates the algorithms allowed for your application. By default, a large list of algorithms is defined, but you can add custom algorithms or reduce the list.
It is not recommended to change the default list unless you exactly know what you are doing.
Please note that the metadata service is mandatory to use this option.
The use of Attestation Statements is generally not recommended unless you REALLY need this information.
The mechanism for generating public key credentials, as well as requesting and generating Authentication assertions, can be extended to suit particular use cases. Each case is addressed by defining a registration extension.
This set of options allows you to select authenticators depending on their capabilities. The values are described in of the protocol.
If you need the , you can specify the preference regarding attestation conveyance during credential generation.
The example below is tatolly fictive. Some extensions are but the supports depends on the authenticators and on the relying parties.