Skip to content

Add option to enter a otpauth:// URI in the TotpSetupDialog#13048

Open
Max-F-Helm wants to merge 1 commit intokeepassxreboot:developfrom
Max-F-Helm:feature/totp-url-parsing
Open

Add option to enter a otpauth:// URI in the TotpSetupDialog#13048
Max-F-Helm wants to merge 1 commit intokeepassxreboot:developfrom
Max-F-Helm:feature/totp-url-parsing

Conversation

@Max-F-Helm
Copy link

This PR adds the option to use OTP URIs in the TotpSetupDialog. This does not implement all of #4825, but it is a start.
On save, the URI is parsed and the parameters are stored as custom settings.

The changes also include some refactoring inside TotpSetupDialog.cpp to separate the setting creation of every mode.

Screenshots

ui

Testing strategy

The change was tested by using a URI from a real auth manager which supports TOTP.
Entering of an invalid URI was also tested.
The code itself has no unit-tests as most of it is UI and the part where the URI is parsed was taken from Totp::parseSettings().

Type of change

  • ✅ New feature (change that adds functionality)
  • ✅ Refactor (significant modification to existing code)

@0zitro
Copy link

0zitro commented Feb 11, 2026

For anyone looking to still use this before the PR lands, you can add an otp "additional attribute" (under Advanced) where the value is the otpauth:// URI, and make it protected by checking the "Protect" checkbox (context: was looking how to do it from the CLI, and this is apparently the only way to set up TOTP from there)

Also while I'm at it, would it be a good idea to add a protocol handler for otpauth:// URIs and present a dialogue to choose the entry which to setup the TOTP for?
I believe this would be big if the infra for the dialogues is there! (don't know much about the codebase state right now)

Edit: Oh well, @scarlion1 has already mentioned this workaround, funny how I missed it: #4825 (comment)

@Max-F-Helm
Copy link
Author

The protocol handler idea sounds good. But as I have no knowledge how these things work (on all platforms) I would like to get feedback from the maintainers if this is a useful addition, before I spend time digging through all necessary documentation.

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.

2 participants