Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add {COPY:field} to Auto-Type tokens to copy named field to clipboard #2215

Closed
lordloh opened this issue Aug 19, 2018 · 26 comments
Closed

Add {COPY:field} to Auto-Type tokens to copy named field to clipboard #2215

lordloh opened this issue Aug 19, 2018 · 26 comments
Assignees

Comments

@lordloh
Copy link

lordloh commented Aug 19, 2018

Expected Behavior

KeepassXC should (optionally) not minimize after auto type (discussed at https://sourceforge.net/p/keepass/discussion/329221/thread/fd0e9e5a/) The people at that time (2013) thought that there was no further need for Keepass after auto-type.

Current Behavior

KeepassXC minimizes after autotype

Possible Solution

Have a setting under Tools > settings > General > Basic

Context

I often have to copy the TOPT after auto type. I would also love to be able to double click and copy TOTP like the user name and passwords, but can live with the rightclick > Time-based one time passwords > copy OTP or Show OTP, but the window minimizing all the time does gets irritating. Different users have different work flows and at times, I may have to have 3 to 4 logins within 10min. So, an option to prevent or enable minimize after auto-type may be useful for some users (like me).

Debug Info

KeePassXC - Version 2.3.3
Revision: 0a155d8

Libraries:

  • Qt 5.10.1
  • libgcrypt 1.8.2

Operating system: Windows 10 (10.0)
CPU architecture: x86_64
Kernel: winnt 10.0.17134

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • Legacy Browser Integration (KeePassHTTP)
  • SSH Agent
  • YubiKey
@droidmonkey
Copy link
Member

I think a better solution, since OTP are getting very popular, is to create an AutoType global keyboard shortcut specifically for the TOTP typing.

@lordloh
Copy link
Author

lordloh commented Aug 20, 2018

@droidmonkey - that would be good to have. It was brought up in #1892.

I cannot find the issue, but I came across one yesterday where people strongly felt that storing the OTP secret in the same database as username and password defeats the purpose. Using 2 database on the phone version of the app would be a nightmare. Moreover, someone even thought of the KeepassXC DB as just a backup store for the secret.

@TheZ3ro
Copy link
Contributor

TheZ3ro commented Aug 20, 2018

The fact is that you need to minimize KeePassXC in order to send keystrokes to the target application, after that you need to re-invoke the KeePassXC window.

This has some issue if you disable the auto-enter autotype shortcut (sending automatically {ENTER} after every autotype sequence.

The best thing is adding a shortcut to minimize/maximize the KeePassXC window.

Expected Behaviour:

  1. Press Autotype shortcut
  2. Autotype is performed
    1. Press enter if needed
  3. Press Minimize/Maximize shortcut
  4. Copy and paste TOTP

@lordloh
Copy link
Author

lordloh commented Aug 20, 2018

Okay. So it is a limitation.

Are there reasons that makes a double click copy of OTP a bad idea? How about an option to put the TOTP (if it exists) into the clipboard on clicking auto-type?

@TheZ3ro
Copy link
Contributor

TheZ3ro commented Aug 21, 2018

I actually like your proposal and we should make an autotype sequence keyword for it.

Something like {USERNAME}{TAB}{PASSWORD}{ENTER}{TO-CLIP:TOTP}

TO-CLIP is the main token and after the : you can place any entry field (also custom field with typical syntax S:field)

@droidmonkey
Copy link
Member

droidmonkey commented Aug 21, 2018

How about {COPY:field}

@TheZ3ro
Copy link
Contributor

TheZ3ro commented Aug 21, 2018

I like the COPY token

@lordloh
Copy link
Author

lordloh commented Aug 21, 2018

Looks like this has turned into a new "Enhancement" request. Should a new issue be created?

@TheZ3ro @droidmonkey - This is too far ahead but, should you implement {COPY:}, do you propose to clear the clipboard as a part of {COPY:} or something like {COPY:}{DELAY 30000}{CLEAR-CLIP}? Perhaps it dose not matter as TOTPs are useless after 30sec anyway.

@droidmonkey
Copy link
Member

We would use the configured clipboard clearing time. It would be incumbent on the user to configure their autotype correctly to incorporate delays and such. We can keep this same issue to track the enhancement, I changed the title.

@droidmonkey droidmonkey changed the title Prevent minimization after Auto-type Add {COPY:field} to Auto-Type tokens to copy named field to clipboard Aug 21, 2018
@Saroumane
Copy link

The {COPY:field} is such a great idea !
Sometimes you found a website where the password field is unreachable by "TAB", so filling the clipboard with the password is a good way to mitigate the problem. (You still have to click on the field with the mouse and paste it, of course)

@BillDietrich
Copy link

{USERNAME}{TAB}{PASSWORD}{ENTER}{TO-CLIP:TOTP}

That's the functionality I want (I don't care if it's TO-CLIP or COPY or whatever).

@droidmonkey
Copy link
Member

We do support the {TOTP} placeholder

@BillDietrich
Copy link

Yes, but I want it into the clipboard because often the TOTP has to be put into next web page, some variable number of seconds later.

@droidmonkey
Copy link
Member

droidmonkey commented Oct 23, 2020

You can also add {DELAY 2000} to add a 2 second delay. Just some workarounds while this is open.

@droidmonkey
Copy link
Member

I decided not to implement this feature. The revamped Auto-Type select dialog now includes the ability Auto-Type or copy to clipboard the username, password, or totp of an entry. We do not encourage the use of the clipboard and embedding that into Auto-Type defeats the purpose of Auto-Type.

@droidmonkey droidmonkey removed this from the v2.7.0 milestone Nov 15, 2020
@jaaan-t
Copy link

jaaan-t commented Feb 19, 2021

Can be done by using the KeePassOTP plugin and this keystroke sequence: {CLIPBOARD-SET:/{KPOTP}/}
Shows red (invalid?), but works nonetheless.

@BillDietrich
Copy link

There is no way to use that plugin in KeePassXC, unless I am greatly mistaken.

If I try to use that keystroke sequence, I get "syntax error", and there is no way to get around that error and save the entry anyway.

I'm using KeePassXC 2.6.4

@BillDietrich
Copy link

The revamped Auto-Type select dialog now includes the ability Auto-Type or copy to clipboard the username, password, or totp of an entry.

What is the "Auto-Type select dialog" ? I don't see that in my copy of KeePassXC. How do I copy TOTP to clipboard ?

@droidmonkey
Copy link
Member

droidmonkey commented Feb 19, 2021

This is a future feature #5864

@carstenjaksch
Copy link

@droidmonkey Some sites do not recognize TOTP typed by KeePassXC.

For example, the code gets inserted only in the first box at hosting.de login screen. Normally, when typing the TOTP, some JS automatically selects the next input box after each key press. That does not happen with auto-type.

Bildschirmfoto 2022-08-19 um 12 39 32

I beg you, please reconsider implementing a copy function.

@droidmonkey
Copy link
Member

It is already implemented.... you have several options:

  1. Copy TOTP from the Auto-Type selection dialog (can also press Ctrl + 3)
  2. Add a {DELAY=500} to your typing sequence to slow the typing between characters
  3. Don't use Auto-Type at all and just copy the totp code from the entry view
  4. Use the browser extension.

@carstenjaksch
Copy link

Thank you for the quick response.

  1. Copying from the selection dialog could be a workaround, but that defeats the purpose of auto-type: Automation.
  2. {DELAY=500} does not work in that case, unfortunately.
  3. Again: That would not be an automated solution, as I have to go to the KeePassXC window, maybe search for the entry, select it, copy the TOTP, go back to the browser and insert the code.
  4. The browser extension works so far, but I see two disadvantages here: It is not available for Safari and I need to click three to five times (open KeePassXC tooltip, maybe select login, click on submit, click on the green TOTP button, maybe submit the code too). With auto-type, there were only the shortcut, maybe enter for the dialog (if displayed) and inserting the code.

A copy function for auto-type would be so much more convenient, in my opinion.

@droidmonkey
Copy link
Member

droidmonkey commented Aug 19, 2022

that defeats the purpose of auto-type: Automation

That is not the purpose of Auto-Type. It's purpose is to avoid using the clipboard. As a side benefit you can automate some actions through the keyboard if you wish to do so.

You can use a higher value than 500 in the delay, that was just an example.

@carstenjaksch
Copy link

carstenjaksch commented Aug 19, 2022

A higher value makes no difference. I can watch how the TOTP numbers get deleted after being inserted one by one.

A workaround could be to use TAB between the TOTP numbers. Is that possible somehow?

@droidmonkey
Copy link
Member

That is not possible. Since this website appears to be broken there is nothing we can do to fix this from an Auto-Type keyboard perspective.

@carstenjaksch
Copy link

You could add an option to automatically copy the TOTP, as most password managers offer. 🙂

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

No branches or pull requests

7 participants