-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
TOTP support #14
Comments
Great to see you're using However, if this really is something you're missing, I'd be happy to take a look into implementing it. Does Please note that you can use |
@timvisee I do understand some folks are of that opinion. I keep my GPG on a yubikey with its own PIN so it clears my bar for "enough like a second factor". I do think that Thanks for prs and being open to this feature request! |
Do you have a suggestion for how this could be configured? I'm thinking of putting the secret token in a regular pass file like:
because gopass seems to do it that way. And the following commands to work with this: prs totp show myfile
prs totp copy myfile
prs totp live/watch myfile
prs totp add/edit myfile
prs totp help
# or their shorts
prs otp s
prs otp c
prs otp w
prs otp a Where watch and copy would simply stdout the current token. Watch would keep showing the token with a timer. Add would prompt you for the secret token to merge into a file (or create a new file). And maybe a Note that I haven't worked with TOTP on a CLI before, so I might be missing useful stuff. |
The UX that I'm going from with gopass is roughly:
(it's a little much, imo, with the progress bar, but it loops and spits out totp codes til killed)
from the gopass manpage:
The otpauth url seems to support extra parameters in the URL too, I think one or two of mine generated 8 digit codes, and that appears in the otpauth url. If you need specifics I can I don't know if Password Store for Android supports both. I think I basically use |
Thanks for your elaborate answer. Yes, could you query your store for any other formats you may be using? For example: do you always use I have a basic TOTP token show command working now on a separate branch. The I'm asking this how because knowing this might speed up implementing this. The workflow will likely be a little bit different, to eliminate ambiguity and improve usability. It'll definitely be less noisy. Do you have any suggestions thus far? |
So Any time that I have the otpauth url entry, it is on its own line. Granted, gopass has been more and more aggressive about trying to parse out the extra data, and recently affected some 2fa codes (hence why I opened this issue, actually). I can confirm the Android app is able to generate TOTP codes for both formats. |
I've implemented the first TOTP bits. Would you mind to test it out? I'd love to hear about your findings and opinions on the following:
You can find a binary here. This adds:
And variations:
$ prs totp show test
109 152 (valid for 12s)
$ prs totp show test -q
109152
$ prs totp copy test
Token copied to clipboard. Recopying changing token after 12 seconds...
Token copied to clipboard. Clearing after 8 seconds...
$ prs totp copy test --no-recopy
Token copied to clipboard. Clearing after 20 seconds...
$ prs totp live test
109 152 (valid for 12s)
# updates live
$ prs totp live test -q
109152
# updates live
$ prs totp live test --follow
109 152 (valid for 12s)
123 456 (valid for 30s)
654 321 (valid for 30s)
# updates live You can have multiple TOTP secrets in a single file if you'd like. By default the
and use prs totp show -p totp1
prs totp show -p totp2
prs totp show -p other Please see |
Interestingly I circled back to this when I noticed that gopass didn't support Steam, and it seems totp-rs doesn't either. Understandable given the text of the RFC but all the same I opened this: constantoine/totp-rs#45 Initial testing otherwise seems to work but I'd like to test further before saying I properly vetted it. Thanks! It might be my imagination but it felt very snappy already. |
Here's a failure with
|
Hi ! I am really excited by this project as it makes a CLI for pass on windows possible ! (and I love Rust) Just to say that I have the same issue with PayPal TOTP too: it is only 80 bits. This can be a stong argument for |
@colemickens Thanks for getting back to me. The 128-bit size is enforced by If @Pantamis Awesome to hear, thanks! Thank you for noting PayPal also uses a smaller amount of bits, that's strengthens the argument to support < 128-bits. |
I've implemented support for Steam tokens and short TOTP secrets. This is on a totp-rs downstream development branch, and I'm unsure if this will be fully implemented upstream. Anyway, the important thing is: Steam tokens and short secrets work now. @colemickens @Pantamis Would you both mind to give it another spin (for Steam and Discord/PayPal)? You can find the latest binary here: https://gitlab.com/timvisee/prs/-/jobs/3544324842/artifacts/browse (source) |
I'll need to reboot to Windows later to troubleshoot against the desktop authenticator to see if I've made a mistake or if there's a bug. edit: I spot checked maybe 10-12 other entries, they all generated codes, though I didn't test those. |
@colemickens Thanks for testing. I assume your Steam entry to have a different format then what I got, causing parsing issues. Could you share its URI (with the secret blacked-out)? |
I tested PayPal and Discord, it works for me too now ! (and the generated code is correct) I compiled I don't have Steam account so I can't test for this setting. |
And for good measure:
edit: oops, so much for censoring the steam username :P |
@colemickens Thanks for giving this a spin! I've recently made some changes that should improve things. The latest binary can be found here: https://gitlab.com/timvisee/prs/-/jobs/3562589842/artifacts/browse Your otpauth URL for Steam doesn't have enough information for it to be properly detected. The Steam desktop authenticator tool probably doesn't care because Steam is the only type it supports. You should set the issuer to Besides, I see that you've set the period to 60. I believe this must be 30 for Steam. Changing your URL to this should do the trick: Ps: to view live output use |
Awesome to see it works now! I wonder what could be done to improve parsing, but since it isn't standardized this is probably very hard. I'll leave this open until a new prs version is released that includes this. |
The only thing I can think of is some documentation, either on |
|
I was very excited to finally get rid of
gopass
but it seems prs is missing totp functionality. It would be great if it could be supported.The text was updated successfully, but these errors were encountered: