BrandonPotter/GoogleAuthenticator

Update to use .Net 6

ragavendra opened this issue · 5 comments

Can we have the samples updated to use .Net 6.0 and/ or higher.

Also, nice to have either requirements to setup the Authenticator app in Readme file or in the code comments.

ahwm commented

I'm not sure I'm following. The code in the readme is the same for every supported framework. The samples show it in action and doesn't matter what framework you're using. If you have specific issues with the samples those can be separate issues.

What requirements are you referring to?

hi,

When I try to build the web sample, I get the below error.

/home/user/.dotnet/sdk/6.0.xx/Microsoft.Common.CurrentVersion.targets(1217,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/user/authrepo/GoogleAuthenticator/Google.Authenticator.WebSample/Google.Authenticator.WebSample.csproj]

Build FAILED.

I am assuming because I have .Net 6.0 in my machine.

In the README it says to store the key, which key is it referring to? Is it the app key we get from creating the app in the Google developer site.

ahwm commented

Ah, I see. Okay, yeah. The samples only work on Windows. I will work on porting those.

The "key" that's referenced is the secret key that your application generates for the specific user. So a user will make some request to enable 2FA/Google Authenticator through your application and a secure key is generated. That key is what is stored in your application because you have to use the same key (or "secret") every time you authenticate a user's TOTP.

@ahwm .... thanks a lot for this. This is working in .Net6.0 now. I was actually writing similar snippet and thought to send a pull request for the same.

Please let me know if there is similar areas for contribution as this can help me improve my C# skills.