Skip to content

Implement a dialog for setting new device PIN#135

Draft
msirringhaus wants to merge 2 commits intolinux-credentials:mainfrom
msirringhaus:setpinpage
Draft

Implement a dialog for setting new device PIN#135
msirringhaus wants to merge 2 commits intolinux-credentials:mainfrom
msirringhaus:setpinpage

Conversation

@msirringhaus
Copy link
Collaborator

@msirringhaus msirringhaus commented Feb 11, 2026

Only NFC and USB for now. Hybrid makes no sense, and I don't have anything to test BLE right now. USB and NFC both work.

Flow of how this works:
Upon "PinNotSet"-error during registration, there will be a page telling the user that the RP requires additional protection on the device, e.g. a PIN, which will affect the whole device. There are two buttons: "Close", "Set PIN on device". Close closes the window. "Set PIN on device" brings the user to another page that offers 2 password-entry fields. "Continue" will be disabled until both fields are non-empty and identical. On pressing "Continue", the PIN is set for the device.

Some known issues with this implementation:

  1. On error (e.g. PinTooShort) the window just swaps to the general error page and the user needs to close and start again. [solved. User is now dropped to the page with the "Set PIN on device"-button, with error text about PIN policy violation]
  2. On success, the window simply closes. The PIN is now set and the request needs to be issued again. But this is not really communicated in a good way. This is actually a general bug. The window is supposed to stay open for a bit in general to show "Done", but in practice gets closed right away because some cancel-request overrides it.
  3. No tests. Not sure how to test that.
  4. No check yet if the device even supports a PIN, before we show this dialog. We would need the deviceInfo on the UI-side for this, which we currently don't have. Or an additional API call to ask credentialsd what kind of UV the device supports?
  5. I'm also not a big fan on how credentialsd handles the event, but also couldn't come up with a better approach. It basically starts a fresh "Select the device you want, then continue with request 'Setting new PIN' on that device"-cycle, which may result in weird UX, if multiple devices are plugged in. But I also don't really know how to go directly for the previously selected device.

Thus, I marked this PR a draft for now. Maybe @iinuwa has some suggestions for some of these problems?

@msirringhaus msirringhaus requested a review from iinuwa February 11, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant