pass-otp icon indicating copy to clipboard operation
pass-otp copied to clipboard

pass-otp doesn't support otp codes with "otpauth: " before them

Open ltecheroffical opened this issue 11 months ago • 4 comments

Let's say i'm using passff, if I don't include "otpauth: " before an otp code then it doesn't notice that an otp code is there but if I do include it before an otp code, then it breaks.

ltecheroffical avatar Mar 12 '24 06:03 ltecheroffical

Unsure what you mean, as far as I know, a valid otpauth:// URI is required to use pass-otp to generate codes, a secret alone won't work.

The URI should look like this: otpauth://totp/user?period=xx&digits=xx&algorithm=xx&secret=xx&issuer=xx

This way OTP works with pass, with some modifications even for Steam

0xphk avatar Jun 15 '24 16:06 0xphk

Talking about these kinds of codes:

otpauth: otpauth://totp/user?period=xx&digits=xx&algorithm=xx&secret=xx&issuer=xx

A few extensions require this format

ltecheroffical avatar Jun 15 '24 18:06 ltecheroffical

Ah ok, never seen it in this format, sorry I thought you were referring to plain keys.

0xphk avatar Jun 17 '24 17:06 0xphk

The extension is just bash, you could modify the otp_parse_uri() function in the /usr/lib/password-store/extensions/otp.bash library to get rid of the extra otpauth: at the start of the line. But that's just a quick idea.

The current pattern match is ^otpauth:\/\/(totp|hotp)[snip...] which expects an otpauth URI from the start of the line

If the few extensions are parsing this entry correctly, you could just add both lines.

With the valid URI and with the additional otpauth: at the start. Pass-OTP still matches the correct one, maybe the extension is able to do so as well.

0xphk avatar Jun 17 '24 17:06 0xphk