To authenticate your users, you need to create a PublicKeyCredentialRequestOptions
object. You can create this object using the .... Similarly to the authentication registration process, there is another approach.
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\PublicKeyCredentialRequestOptionsFactory
. To use it, you must first create a least one profile in your configuration file.
No other option is needed to create a profile!
With this profile, now we can create options with the following code lines:
As mentioned earlier, it is preferable to indicate the Relying Party ID. By default it is set to null
i.e. the current domain is used.
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:
By default, the authenticator will verify the user if it is possible. You can enforce or disable the user verification using this option.
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.
The example below is tatolly fictive. Some extensions are defined in the specification but the supports depends on the authenticators and on the relying parties.