Authenticate Your Users
webauthn:
request_profiles:
acme: ~use Webauthn\Bundle\Service\PublicKeyCredentialCreationOptionsFactory;
use Webauthn\PublicKeyCredentialUserEntity;
// UseEntity found using the username.
$userEntity = $userEntityRepository->findWebauthnUserByUsername('john.doe');
// Get the list of authenticators associated to the user
$credentialSources = $credentialSourceRepository->findAllForUserEntity($userEntity);
// Convert the Credential Sources into Public Key Credential Descriptors
$allowedCredentials = array_map(function (PublicKeyCredentialSource $credential) {
return $credential->getPublicKeyCredentialDescriptor();
}, $credentialSources);
$publicKeyCredentialCreationOptions = $container
->get(PublicKeyCredentialCreationOptionsFactory::class)
->create('acme', $allowedCredentials)
;Relying Party ID
Challenge Length
Timeout
User Verification
Extensions
Last updated
Was this helpful?