tadfisher / pass-otp

A pass extension for managing one-time-password (OTP) tokens
GNU General Public License v3.0
1.28k stars 85 forks source link

When totp secret has spaces otp code is coming as invalid #132

Open rajashekar opened 3 years ago

rajashekar commented 3 years ago

Try this tool - https://totp.danhersam.com/ with below params give secret as - abcd abcd abcd abcd abcd abcd Number of digits - 6 interval as 30

Insert above secret

pass otp insert -s -a test otp/test.com

and try to generate otp

pass otp otp/test.com

The generated code is not matching with actual one. Tried the same totp secret with other apps like password-store they are showing correct code which is matching with tool https://totp.danhersam.com/

miikanissi commented 3 years ago

I'm having the same issue, is there something we are missing?

rajashekar commented 3 years ago

I think its because of spaces between the secret. After removing spaces, its working as expected. Might be during adding secret at prompt, stripping out spaces might fix this issue.

miikanissi commented 3 years ago

I think its because of spaces between the secret. After removing spaces, its working as expected. Might be during adding secret at prompt, stripping out spaces might fix this issue.

Removing spaces didn't fix it for me. But I was able to add the secret by scanning the qr code.

gabrielhidasy commented 3 years ago

I have the same problem with Google and Amazon OTPs, but they do work after I remove the spaces.