Skip to content

Abu-Habibah/GoogleAuthenticatorService.Core

 
 

Repository files navigation

GoogleAuthenticatorService.Core

Description

This library was rebuilt of https://github.com/BrandonPotter/GoogleAuthenticator, which is built for .NET Framework. This library is meant to setup and use two-factor authentication with Google Authenticator for .NET Core 2.0

Installation

Via Nuget

Install-Package GoogleAuthenticatorService.Core

Getting started

  1. Generate Setup Code.
TwoFactorAuthenticator Authenticator = new TwoFactorAuthenticator();
var SetupResult = Authenticator.GenerateSetupCode("<Title>", "<Secret Key>", 250, 250);
string QrCodeUrl = SetupResult.QrCodeSetupImageUrl,
string ManualCode = SetupResult.ManualEntryKey
  1. You'll get something like this. Imgur

  2. Setup Code to your Google Authenticator App.

  3. When using, you can verify code like this.

TwoFactorAuthenticator Authenticator = new TwoFactorAuthenticator();
bool ValidateResult = Authenticator.ValidateTwoFactorPIN("<Secret Key>", "123456");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%