Skip to content

Make security key selection more flexible #256

Open

Description

@iinuwa

In response to feedback from the GNOME Design team, we need some more flexibility for different ways of selecting a security key:

  • physical: allow a user to touch a USB security key to select it
  • virtual: allow a user to view the connected USB security keys and click a button in the menu to start using it.
  • automatic: if a single USB security key is plugged in, then automatically start the ceremony on it.

Currently, we only support the first (physical). I think the latter two can be achieved by syncing a list of available devices to the backend, and then add a function on the frontend to select one of these devices by ID. That covers the virtual one. To achieve the automatic selection, the backend can choose, for example:

  • if no devices are connected at the start of the ceremony, and exactly one arrives, automatically select it
  • if exactly one device is present at the beginning of the ceremony, wait 1 second, then automatically select it.

This allows credentialsd not to mandate a specific pattern for selecting devices, and desktop environments can decide what's best for their users.

I think this means a few things:

  • We need a way to identify USB devices when they are plugged in. This can be as simple as an index
  • We need to query authenticator info for the name of the model for display purposes.
    • This might mean we'd need to cache the output of getInfo in the device struct.
  • We need to make devices a property of the ceremony that can be monitored for changes.

We have a pattern for receiving user input in the Enter PIN and credential selection flows. We can copy that for this input.

We may also want to consider updating our polling API to allow streaming in updates to the device list instead of polling, which would be more efficient and easier to track a stable list. (This is also a consideration for NFC, so I'll post this as a separate issue.)

Activity

  1. iinuwa commented on Nov 9, 2026

    @iinuwa
    MemberAuthor

    We need a way to identify USB devices when they are plugged in. This can be as simple as an index

    For USB, maybe we could have libwebauthn expose a value based on the nonce returned by CTAPHID_INIT. Not sure if this maps to other transports.

  2. kpanuragh commented on Nov 11, 2026

    @kpanuragh
    Contributor

    I'd like to work on this. My plan is to start with the "virtual" mode:

    • In the USB flow, publish the connected devices to the UI with a simple per-ceremony index as the ID (for now, until libwebauthn can give a stable ID).
    • Add a device-selection input that follows the existing PIN and credential-selection pattern. Selecting a device starts the ceremony on it, and touching a key still works as it does today.
    • Then add the automatic mode in a follow-up PR: if exactly one device is present at the start or arrives first, select it after a short delay.

    Model names would come later, once #257 and linux-credentials/libwebauthn#327 are settled. @msirringhaus, does this conflict with #231? I'm happy to base this on it or wait until it's merged. Does this split sound OK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions