Open
Description
When we provide a secret_key, example coming from a database and generate the OTP, using the code below, the URL generated is encoded version of the secret key and thus validate will fail because the secret key stored in the authenticator is encoded value of the secret key
key, err := totp.Generate(totp.GenerateOpts{
Issuer: "Issuer",
AccountName: username,
Secret: []byte(user.SecretKey),
})
var buf bytes.Buffer
img, err := key.Image(200, 200)
if err != nil {
panic(err)
}
png.Encode(&buf, img)
Metadata
Metadata
Assignees
Labels
No labels