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

TOTP not match If we pass totpSize = 6 and step = 60 #65

Open
kalpesh2804 opened this issue Sep 12, 2024 · 1 comment
Open

TOTP not match If we pass totpSize = 6 and step = 60 #65

kalpesh2804 opened this issue Sep 12, 2024 · 1 comment

Comments

@kalpesh2804
Copy link

This code result match with Google Authenticator

var base32Bytes = Base32Encoding.ToBytes(key);
var totp = new Totp(base32Bytes);
var totpCode = totp.ComputeTotp();

This code result not match with Google Authenticator

var base32Bytes = Base32Encoding.ToBytes(key);
var totp = new Totp(base32Bytes, totpSize: 6, step: 60);
var totpCode = totp.ComputeTotp();

Google Authenticator URI example

var uriString = new OtpUri(OtpType.Totp, key, "[email protected]", "Test Not Working", digits: 6, period: 60).ToString();

@orlys
Copy link

orlys commented Dec 18, 2024

period must be 30.

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

No branches or pull requests

2 participants