BrandonPotter / GoogleAuthenticator

Simple, easy to use server-side two-factor authentication library for .NET that works with Google Authenticator and Authy.
Apache License 2.0
369 stars 126 forks source link

QrCodeSetupImageUrl gives empty string #235

Closed nathanvj closed 1 week ago

nathanvj commented 1 week ago

[Issue can be deleted, updated the NuGet package again. This time I completely rebuild the project afterwards, then it worked.]

This is not really a bug, since I haven't been able to reproduce it, but I was wondering if anyone could give me any pointers in the right direction.

I'm currently using the GoogleAuthenticator package in my .NET 6 API project. It has always worked perfectly, but recently the GenerateSetupCode is returning an empty string for the QrCodeSetupImageUrl.

This is the code I'm using:

SetupCode setupInfo = _authenticator.GenerateSetupCode(
        _authSettings.TwoFactorOptions.Issuer,
        user.Email,
        TwoFactorHelper.GenerateTwoFactorKey(user, _authSettings.TwoFactorOptions.Secret),
        secretIsBase32: false,
        qrPixelsPerModule: 3);

I have confirmed the _authSettings.TwoFactorOptions.* are properly defined. The ManualEntryKey works fine. Thanks in advance for any suggestions / help.

ahwm commented 1 week ago

Glad you were able to get it worked out.