Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Emzi0767 committed Sep 8, 2020
1 parent 68e8fab commit b53c2db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
A simple, lightweight, and easy to use implementation of One-Time Password protocol, both time-based and counter-based
variants.

## Installation
To start using the package, just [install it from NuGet](https://www.nuget.org/packages/EzOTP/).

## Usage
The library is designed to be fairly straightforward and easy to use.

Expand Down Expand Up @@ -71,7 +74,7 @@ Assuming that user-provided code is in an `int` variable called `userCode`, one
```cs
var otp = OtpGenerator.ParseUri("otpauth://totp/ACME%20Co:john@example.com?secret=DGW24UIKQZBELXEMY64PICAL5IGYMJM6&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30");
if (!otp.GenerateRawWindow(window: 1).Contains(userCode))
// fail the authentication process
// fail the authentication process
```

The method optionally takes a `window` argument, which defines the window size. Given a window size of `n`, EzOTP will
Expand All @@ -90,6 +93,13 @@ The configuration instance can then be supplied to the constructor of `OtpGenera
generator state and restoring it without having to use URIs. This is useful for HOTP particularly, where the counter
value has to be re-recorded after every generation.

### Generating Google Authenticator URIs
One can easily generate configurations for Google Authenticator, by using `GenerateGoogleAuthenticator()` static method
on either `TotpGeneratorConfiguration` or `HotpGeneratorConfiguration` classes.

These methods return configuration objects, that can then be plugged into `OtpGenerator` constructor, or just returned
as an URI to a user.

## Support me
Lots of effort went into making this software.

Expand Down

0 comments on commit b53c2db

Please sign in to comment.