Skip to content

Must use AlgorithmSHA1 with iOS version of Google Authenticator #55

@yghazi

Description

@yghazi
        key,_ := totp.Generate(totp.GenerateOpts{ 
              AccountName: "XYZ Test", 
              Issuer: "some.domain.com", 
              Algorithm: otp.AlgorithmSHA512, 
        })
        
        var buff bytes.Buffer
	img, _ := key.Image(256,256)
	f, _ := os.Create("test.html")
	png.Encode(&buff, img)
	encodedString := base64.StdEncoding.EncodeToString(buff.Bytes())
	htmlImage := "<img src=\"data:image/png;base64," + encodedString + "\" />"
	l, err := f.WriteString(htmlImage)
	if err != nil {
		log.Println(err)
	}

The resultant test.html shows a QR code that provides correct codes when scanned with Google Authenticator on Android, but not on iPhone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions