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

MS Authenticator shows email domain when using email as label (account name) instead of issuer #19

Open
mhagesfeld opened this issue Mar 10, 2021 · 1 comment

Comments

@mhagesfeld
Copy link

If I use an email address as the "label" in creating the QR code, Microsoft Authenticator uses the domain from the email as the Issuer, rather than the provided issuer.

To wit:
EX 1 - Not Email (i.e. sample code):

  • private readonly TwoFactorAuth tfa = new TwoFactorAuth("MyCompany", qrcodeprovider: new QRCoder.QRCoderQRCodeProvider());
  • Model.GetQrCodeImageAsDataUri("Bob Ross", (string)Session["secret"])"

RESULT:
image

EX 2 - Email Label:

  • private readonly TwoFactorAuth tfa = new TwoFactorAuth("MyCompany", qrcodeprovider: new QRCoder.QRCoderQRCodeProvider());
  • img src="@Model.GetQrCodeImageAsDataUri("[email protected]", (string)Session["secret"])"
    RESULT:
    image

image

However, the email DOES work properly in Google Authenticator:
image

Any ideas?

@minzdrav
Copy link

minzdrav commented Aug 3, 2023

For guys like me, who is searching for solution:

var tfa = new TwoFactorAuth("YourSiteName", qrcodeprovider: new QRCoderQRCodeProvider());
var secret = tfa.CreateSecret();
var qr = tfa.GetQrCodeImageAsDataUri($"YourSiteName:{userEmail}", secret);

Code is tested in microsoft and google authenticators.

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