Additional Authenticators

Users can register multiple authenticators to their account for backup purposes or to use different devices. This page explains how to manage multiple authenticators per user.

Why Multiple Authenticators?

Allowing users to register multiple authenticators provides several benefits:

  • Backup authenticators: If a user loses their primary device, they can still access their account

  • Multiple devices: Use work laptop, personal phone, and security key

  • Device upgrades: Smoothly transition when replacing devices

  • Shared accounts: Family members can each use their own authenticator (if your security policy allows)

Listing User Authenticators

Display all authenticators registered to the current user:

src/Controller/SecurityController.php
<?php

declare(strict_types=1);

namespace App\Controller;

use App\Repository\WebauthnCredentialRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;

#[IsGranted('ROLE_USER')]
class SecurityController extends AbstractController
{
    #[Route('/security/authenticators', name: 'app_list_authenticators')]
    public function listAuthenticators(
        WebauthnCredentialRepository $credentialRepository
    ): Response {
        $user = $this->getUser();
        $userHandle = $user->getUserIdentifier(); // Or your user ID method

        $credentials = $credentialRepository->findAllForUserEntity($userHandle);

        return $this->render('security/authenticators.html.twig', [
            'credentials' => $credentials,
        ]);
    }
}

The controller configuration for add_device should use CurrentUserEntityGuesser to automatically get the authenticated user. See the User Registration page for configuration details.

Removing Authenticators

Allow users to remove authenticators they no longer use:

Naming Authenticators

Allow users to give friendly names to their authenticators for easier management:

Then allow users to set names during or after registration:

Best Practices

Encourage Backup Authenticators

Prompt users to register a backup authenticator after their first registration:

Authenticator Metadata

Display useful information about each authenticator:

  • Transport types: USB, NFC, Bluetooth, Internal

  • Last used date: Help users identify unused authenticators

  • Registration date: Track when each authenticator was added

  • AAGUID: Identify the authenticator model (if available)

Security Recommendations

  • Minimum authenticators: Consider requiring at least 2 authenticators for privileged accounts

  • Maximum authenticators: Limit to prevent abuse (e.g., 10 per user)

  • Inactive authenticators: Automatically remove authenticators not used for a long period

  • Notification: Email users when authenticators are added or removed

See Also

Last updated

Was this helpful?