DotNetBrightener.TimeBasedOtp 2024.0.12.11621

There is a newer version of this package available.
See the version list below for details.
dotnet add package DotNetBrightener.TimeBasedOtp --version 2024.0.12.11621                
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.12.11621                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetBrightener.TimeBasedOtp" Version="2024.0.12.11621" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetBrightener.TimeBasedOtp --version 2024.0.12.11621                
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.12.11621"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DotNetBrightener.TimeBasedOtp as a Cake Addin
#addin nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.12.11621

// Install DotNetBrightener.TimeBasedOtp as a Cake Tool
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.12.11621                

Time Based OTP Library

© 2022 DotNet Brightener.

Installation

Run this in command line:

dotnet add package DotNetBrightener.TimeBasedOtp

Or add the following to .csproj file

<PackageReference Include="DotNetBrightener.TimeBasedOtp" Version="2022.10.0" />

You should check the latest version from Nuget Site

Usage

Register service

serviceCollection.AddOtpProvider();

In your service / controller:

// inject the service
IOTPProvider otpProvider; 

// generate a secret
var secret = "<some random string>";

// define the length of the password to generate
var passwordLength = 6;

// indicates whether the secret's spaces matter or not.
var ignoreSpaces = false; // false: Spaces matter. true: Spaces don't matter

var otp = otpProvider.GetPassword(secret, passwordLength, ignoreSpaces);

// the adjacent intervals to check for the OTP. The greater this value is, the higher risk of being hijacked.
var checkAdjacentIntervals = 2;

var isOtpValid = otpProvider.ValidateOTP(otp, secret, ignoreSpaces, checkAdjacentIntervals;

Note

The secret should be stored securely within your application.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2024.0.14.6-rc-242750901 0 10/1/2024
2024.0.14.6-rc-242750502 0 10/1/2024
2024.0.14.6-rc-242750201 0 10/1/2024
2024.0.14.6-rc-242741501 24 9/30/2024
2024.0.14.6-rc-242730701 54 9/29/2024
2024.0.14.6-preview-2730501 34 9/29/2024
2024.0.14.6-preview-2701501 47 9/26/2024
2024.0.14.6-preview-2620901 105 9/18/2024
2024.0.14.6-preview-2570701 81 9/13/2024
2024.0.14.6-preview-2510703 99 9/7/2024
2024.0.14.6-preview-2480501 96 9/4/2024
2024.0.14.6-preview-2430401 105 8/30/2024
2024.0.14.6-preview-242730701 34 9/29/2024
2024.0.14.6-preview-2421703 78 8/29/2024
2024.0.14.6-preview-2421701 60 8/29/2024
2024.0.14.6-preview-2420901 77 8/29/2024
2024.0.14.6-preview-2390101 92 8/26/2024
2024.0.14.6-preview-2381603 93 8/25/2024
2024.0.14.6-preview-2341601 108 8/21/2024
2024.0.14.6-preview-2321602 83 8/20/2024
2024.0.14.6-preview-2190801 118 8/6/2024
2024.0.14.6-preview-2041501 85 7/22/2024
2024.0.14.6-preview-1920603 147 7/10/2024
2024.0.14.6-preview-1920301 64 7/10/2024
2024.0.14.6-preview-1911302 94 7/9/2024
2024.0.14.6-preview-1901001 108 7/8/2024
2024.0.14.6-preview-1900901 84 7/8/2024
2024.0.14.6-preview-1900801 83 7/8/2024
2024.0.14.6-preview-1860304 91 7/4/2024
2024.0.14.5 148 7/1/2024
2024.0.14.5-preview-1811601 87 6/29/2024
2024.0.14.5-preview-1810501 106 6/29/2024
2024.0.14.5-preview-180132 100 6/28/2024
2024.0.14.5-preview-180131 92 6/28/2024
2024.0.14.5-preview-180121 84 6/28/2024
2024.0.14.4 110 6/27/2024
2024.0.14.4-preview-7 85 6/27/2024
2024.0.14.3 79 6/21/2024
2024.0.14.1 93 6/6/2024
2024.0.14.1-preview 80 6/6/2024
2024.0.14-preview-1 87 6/6/2024
2024.0.13.8-preview 85 6/6/2024
2024.0.13.1-preview-0146 82 6/6/2024
2024.0.12.15803-preview-03 68 6/6/2024
2024.0.12.15608 102 6/4/2024
2024.0.12.15515 183 6/3/2024
2024.0.12.15220 95 5/31/2024
2024.0.12.15220-alpha31-240... 74 5/31/2024
2024.0.12.14911 134 5/28/2024
2024.0.12.14910-alpha28-240... 75 5/28/2024
2024.0.12.14823 105 5/27/2024
2024.0.12.14522-alpha7-2405... 94 5/24/2024
2024.0.12.14514-alpha6-2405... 94 5/24/2024
2024.0.12.14511 117 5/24/2024
2024.0.12.14314 120 5/22/2024
2024.0.12.14114 94 5/20/2024
2024.0.12.12815 139 5/7/2024
2024.0.12.12814 114 5/7/2024
2024.0.12.12721 112 5/6/2024
2024.0.12.12702 101 5/5/2024
2024.0.12.12622 132 5/5/2024
2024.0.12.12514 101 5/4/2024
2024.0.12.12512 92 5/4/2024
2024.0.12.12510 114 5/4/2024
2024.0.12.12420 92 5/3/2024
2024.0.12.12319 49 5/2/2024
2024.0.12.12319-rc-2405021801 47 5/2/2024
2024.0.12.12318 60 5/2/2024
2024.0.12.12215 95 5/1/2024
2024.0.12.12011 94 4/29/2024
2024.0.12.11720 118 4/26/2024
2024.0.12.11719 101 4/26/2024
2024.0.12.11621 118 4/25/2024
2024.0.12.11523 102 4/24/2024
2024.0.12.11522 104 4/24/2024
2024.0.12.11417 120 4/23/2024
2024.0.12.11400 118 4/22/2024
2024.0.12.11316 111 4/22/2024
2024.0.11.10220 102 4/11/2024
2024.0.11.10120 97 4/10/2024
2024.0.11.10119 78 4/10/2024
2024.0.11.10115 97 4/10/2024
2024.0.11.9914 136 4/8/2024
2024.0.11.9901 105 4/7/2024
2024.0.11.9823 117 4/7/2024
2024.0.11.9401 113 4/2/2024
2024.0.11.9301 95 4/1/2024
2024.0.11.9206 102 3/31/2024
2024.0.11.9205 103 3/31/2024
2024.0.11.8200 125 3/21/2024
2024.0.11.8122 91 3/21/2024
2024.0.11.8120 101 3/21/2024
2024.0.11.7320 166 3/13/2024
2024.0.11.7316 125 3/13/2024
2024.0.11.7310 117 3/13/2024
2024.0.11 120 3/13/2024
2024.0.10 149 3/3/2024
2024.0.9 102 2/27/2024
2024.0.8 166 2/1/2024
2024.0.7 120 1/26/2024
2024.0.6 112 1/25/2024
2024.0.5 106 1/24/2024
2024.0.4 101 1/24/2024
2024.0.3 103 1/22/2024
2024.0.2 170 1/10/2024
2024.0.1 112 1/9/2024
2024.0.1-alpha-3 94 1/9/2024
2024.0.1-alpha-2 80 1/9/2024
2024.0.1-alpha-1 127 1/3/2024
2024.0.0 173 12/26/2023
2023.0.27 135 12/21/2023
2023.0.26 105 12/21/2023
2023.0.25 134 12/11/2023
2023.0.24 123 12/8/2023
2023.0.23 122 12/6/2023
2023.0.21 125 12/4/2023
2023.0.20 153 11/27/2023
2023.0.19 118 11/20/2023
2023.0.18 155 10/25/2023
2023.0.17 180 10/22/2023
2023.0.16 156 10/16/2023
2023.0.16-alpha-1 79 10/16/2023
2023.0.15 141 10/14/2023
2023.0.14 107 10/14/2023
2023.0.13 128 10/14/2023
2023.0.12 122 10/14/2023
2023.0.11 109 10/10/2023
2023.0.10 124 10/9/2023
2023.0.9 147 8/16/2023
2023.0.8 143 8/15/2023
2023.0.8-alpha-2 208 5/31/2023
2023.0.7 138 5/12/2023
2023.0.6 160 5/10/2023
2023.0.5 132 5/7/2023
2023.0.4 157 4/22/2023
2023.0.3 192 4/19/2023
2023.0.2 177 4/6/2023
2023.0.1 185 3/13/2023
2022.9.0 283 10/15/2022