Google Authenticator on Apple devices, certain secrets are not valid

后端 未结 4 1717
闹比i
闹比i 2021-01-18 02:26

We\'ve incorporated two factor authentication into one of our applications using Google Authenticator. In QA, something really weird turned up. While I managed to fix it,

4条回答
  •  旧巷少年郎
    2021-01-18 02:54

    I also have a problem with this.

    This link is valid

    otpauth://totp/xxx.yyy:usertest009%40xxx.yyy?secret=CC5FCZNWTKNTOVN6&period=30&digits=6&algorithm=SHA1&issuer=xxx.yyy
    

    But with diff secret key will make it invalid

    otpauth://totp/xxx.yyy:usertest009%40xxx.yyy?secret=PBUPKS3SLJAP9V2T&period=30&digits=6&algorithm=SHA1&issuer=xxx.yyy
    

    I found out the problems The secret key must be base32 string. I am using NodeJS, so I use speakeasy to create secret String base32. It works now.

提交回复
热议问题