![]() |
VOOZH | about |
dotnet add package GoogleAuthenticator --version 3.2.0
NuGet\Install-Package GoogleAuthenticator -Version 3.2.0
<PackageReference Include="GoogleAuthenticator" Version="3.2.0" />
<PackageVersion Include="GoogleAuthenticator" Version="3.2.0" />Directory.Packages.props
<PackageReference Include="GoogleAuthenticator" />Project file
paket add GoogleAuthenticator --version 3.2.0
#r "nuget: GoogleAuthenticator, 3.2.0"
#:package GoogleAuthenticator@3.2.0
#addin nuget:?package=GoogleAuthenticator&version=3.2.0Install as a Cake Addin
#tool nuget:?package=GoogleAuthenticator&version=3.2.0Install as a Cake Tool
Simple, easy to use server-side two-factor authentication library for .NET that works with Google Authenticator
Install-Package GoogleAuthenticator
Additional examples at Google.Authenticator.WinTest and Google.Authenticator.WebSample
key should be stored by your application for future authentication and shouldn't be regenerated for each request. The process of storing the private key is outside the scope of this library and is the responsibility of the application.
using Google.Authenticator;
string key;
TwoFactorAuthenticator tfa = new TwoFactorAuthenticator();
SetupCode setupInfo = tfa.GenerateSetupCode("Test Two Factor", "user@example.com", key, false, 3);
string qrCodeImageUrl = setupInfo.QrCodeSetupImageUrl;
string manualEntrySetupCode = setupInfo.ManualEntryKey;
imgQrCode.ImageUrl = qrCodeImageUrl;
lblManualSetupCode.Text = manualEntrySetupCode;
// verify
TwoFactorAuthenticator tfa = new TwoFactorAuthenticator();
bool result = tfa.ValidateTwoFactorPIN(key, txtCode.Text)
Added support for HMACSHA256 and HMACSHA512 as per the RFC spec. In testing it was found that several popular apps (such as Authy and Microsoft Authenticator) may not have support for these algorithms so care should be taken by the developer to ensure compatible apps are used.
Fixed an edge case where specifying an interval of 30 seconds to the Validate function would be treated as if you had passed in 0.
libgdiplus is installed as it is no longer used.EscapeUriString to EscapeDataString to encode the "account title" as the former is obsolete in .Net 6. This changes the value in the generated data string from a@b.com to a%40b.com. We have tested this with Google Authenticator, Lastpass Authenticator and Microsoft Authenticator. All three of them handle it correctly and all three recognise that it is still the same account so this should be safe in most cases.Now runs on .Net 6.0.
Technically the QR Coder library we rely on still does not fully support .Net 6.0 so it is possible there will be other niggling issues, but for now all tests pass for .Net 6.0 on both Windows and Linux.
ManualEntryKey interchangeably. ManualEntryKey is used to enter into the authenticator app when scanning a QR code is impossible and is derived from the secret key (discussion example)libgdiplus is installed if you want to generate QR Codes. See https://github.com/codebude/QRCoder/issues/227.| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on GoogleAuthenticator:
| Package | Downloads |
|---|---|
|
GeeksCoreLibrary
Geeks Core Library |
|
|
USNSiteBuilder.Core
Core library for uSkinned Site Builder for Umbraco Version 17 |
|
|
SenseNet.ContentRepository
Content Repository layer for the sensenet platform. |
|
|
FourRoads.TelligentCommunity101.GoogleMfa
Integration with Google MFA |
|
|
QuantFi.Services
Package Description |
Showing the top 11 popular GitHub repositories that depend on GoogleAuthenticator:
| Repository | Stars |
|---|---|
|
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
|
|
|
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
|
|
|
grandnode/grandnode
Open source, headless, multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, Vue.js.
|
|
|
grandnode/grandnode2
E-commerce platform built with ASP.NET Core using MongoDB for NoSQL storage
|
|
|
YAFNET/YAFNET
🌐 YAF.NET - C# ASP.NET Forum
|
|
|
Valour-Software/Valour
Valour is bringing communities into the future with unique features, blazing performance, and respect for users.
|
|
|
0x101-Cyber-Security/NetLock-RMM
The open-source RMM supporting Windows, Linux & MacOS
|
|
| shr670377723/CommunityServer-master | |
|
RaidMax/IW4M-Admin
Complete administration tool for IW4x, Pluto T6, Pluto IW5, Pluto T5, Pluto T4, H1-Mod, CoD4x, IW6x, TeknoMW3, and most Call of Duty® dedicated servers.
|
|
|
SenseNet/sensenet
Open Source Content Services Platform written in .NET
|
|
|
FuseCP/FuseCP
Multi Server Control Panel for Windows based on C#
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.3.0-beta1 | 131,110 | 3/13/2024 |
| 3.2.0 | 3,779,681 | 1/12/2024 |
| 3.1.1 | 604,948 | 10/4/2023 |
| 3.1.1-beta1 | 9,758 | 5/30/2023 |
| 3.1.0 | 868,785 | 5/3/2023 |
| 3.0.0 | 2,027,814 | 6/1/2022 |
| 3.0.0-beta2 | 1,036 | 5/26/2022 |
| 3.0.0-beta1 | 1,507 | 5/6/2022 |
| 2.5.0 | 342,141 | 4/13/2022 |
| 2.4.0 | 282,789 | 12/28/2021 |
| 2.3.0 | 227,133 | 11/30/2021 |
| 2.2.0 | 582,877 | 7/13/2021 |
| 2.1.1 | 632,306 | 12/3/2020 |
| 2.0.1 | 571,885 | 1/10/2020 |
| 2.0.0 | 41,141 | 1/2/2020 |
| 1.2.1 | 1,672,191 | 12/7/2016 |
| 1.2.0 | 155,106 | 9/23/2015 |
| 1.1.0 | 32,930 | 1/7/2015 |
| 1.0.0 | 23,561 | 9/8/2014 |
Added support for HMACSHA256 and HMACSHA512 as per the RFC spec. Care should be taken by the developer to ensure compatible apps are used.