You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use var uriString = new OtpUri(OtpType.Totp,secretBytes,userName,issuer);
the secretBytes will undergo the transformation Base32Encoding.ToString(secret)
in the constructor.
It is entirely possible, that the resulting string ends with an equal sign '='.
In that case, should you put the resulting string in a QR Code generator and try to scan it:
Google Authenticator will inform you that it is not a valid uri.
Microsoft Authenticator will freeze the camera roll and refuse to work until restarted.
Tested on iOS 16.3.1
The string needs to be sanitized, if you remove the trailing '=' character(s), both apps will recognize the Code as valid.
Suggested change in the public override string ToString(): Dictionary<string, string> dictionary = new Dictionary<string, string>() { { "secret", this.Secret } };
to Dictionary<string, string> dictionary = new Dictionary<string, string>() { { "secret", this.Secret.TrimEnd('=') } };
might be enough to fix it.
The text was updated successfully, but these errors were encountered:
If you use
var uriString = new OtpUri(OtpType.Totp,secretBytes,userName,issuer);
the secretBytes will undergo the transformation
Base32Encoding.ToString(secret)
in the constructor.
It is entirely possible, that the resulting string ends with an equal sign '='.
In that case, should you put the resulting string in a QR Code generator and try to scan it:
The string needs to be sanitized, if you remove the trailing '=' character(s), both apps will recognize the Code as valid.
Suggested change in the
public override string ToString()
:Dictionary<string, string> dictionary = new Dictionary<string, string>() { { "secret", this.Secret } };
to
Dictionary<string, string> dictionary = new Dictionary<string, string>() { { "secret", this.Secret.TrimEnd('=') } };
might be enough to fix it.
The text was updated successfully, but these errors were encountered: