Yubico / yubiclip-android

YubiKey NEO OTP to clipboard app for Android
BSD 2-Clause "Simplified" License
41 stars 16 forks source link

Display as notification #5

Closed dainnilsson closed 10 years ago

dainnilsson commented 10 years ago

There could be a setting to instead display the OTP (which might be a shorter value like a static password or a HOTP code) in a notification. The user can then dismiss the notification when they are done, and there could be a "copy to clipboard" button as well.

We should check if it is possible for other applications to read the OTP from a notification, and if possible, avoid it. If this can be done, this could be a safer alternative than copying to clipboard.

gituser94x54102 commented 10 years ago

I think this sounds like a good idea but I have a few questions. Would this be an alternative to the current behavior of "copy directly to clipboard (with toast)" or a replacement for that behavior? As far as displaying the OTP in the clear, would there be an option to obscure the OTP as well? For instance, the notification might just say "Click to copy password to clipboard" and then disappear after 5 minutes or so (similar behavior to KeePass [an open-source password manager]).

dainnilsson commented 10 years ago

I was thinking of having it as an alternative instead of replacement. As for the notification itself, I haven't decided on any specifics, so feel free to leave any suggestions on what you would like to have.

gituser94x54102 commented 10 years ago

I agree with making it an alternative. The only concern I had with the notification was whether the OTP could be obscured for people who may not want their password to show in plaintext.

dainnilsson commented 10 years ago

I've pushed a commit that adds an option to display the code as a notification. It's separate from the copy to clipboard option, so you can have it do one, the other, or both (or none, but that seems useless). I didn't implement any masking of the code for the notification, as I don't see why you would want it enabled unless you actually want to see the code. I also didn't add any "copy to clipboard" button to the notification, as you can still choose to have it automatically copy to clipboard. Additionally, I've made the clear clipboard time configurable.