DotNetBrightener.TimeBasedOtp 2024.0.12.15220-alpha31-24053120

This is a prerelease version of DotNetBrightener.TimeBasedOtp.
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.15220-alpha31-24053120                
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.12.15220-alpha31-24053120                
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.15220-alpha31-24053120" />                
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.15220-alpha31-24053120                
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.12.15220-alpha31-24053120"                
#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.15220-alpha31-24053120&prerelease

// Install DotNetBrightener.TimeBasedOtp as a Cake Tool
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.12.15220-alpha31-24053120&prerelease                

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
2025.0.2-preview-277 63 12/16/2024
2025.0.1-rc-243301701 157 11/25/2024
2024.0.14.6 87 11/25/2024
2024.0.14.6-rc-243031001 129 10/29/2024
2024.0.14.6-rc-243030701 79 10/29/2024
2024.0.14.6-rc-242840501 77 10/10/2024
2024.0.14.6-rc-242820305 76 10/8/2024
2024.0.14.6-rc-242771401 144 10/3/2024
2024.0.14.6-rc-242770501 74 10/3/2024
2024.0.14.6-rc-242770201 84 10/3/2024
2024.0.14.6-rc-242761801 76 10/2/2024
2024.0.14.6-rc-242761601 79 10/2/2024
2024.0.14.6-rc-242761501 77 10/2/2024
2024.0.14.6-rc-242761401 85 10/2/2024
2024.0.14.6-rc-242760701 84 10/2/2024
2024.0.14.6-rc-242751002 79 10/1/2024
2024.0.14.6-rc-242750901 83 10/1/2024
2024.0.14.6-rc-242750502 74 10/1/2024
2024.0.14.6-rc-242750201 80 10/1/2024
2024.0.14.6-rc-242741501 71 9/30/2024
2024.0.14.6-rc-242730701 92 9/29/2024
2024.0.14.6-preview-2730501 77 9/29/2024
2024.0.14.6-preview-2701501 86 9/26/2024
2024.0.14.6-preview-2620901 123 9/18/2024
2024.0.14.6-preview-2570701 91 9/13/2024
2024.0.14.6-preview-2510703 117 9/7/2024
2024.0.14.6-preview-2480501 108 9/4/2024
2024.0.14.6-preview-2430401 115 8/30/2024
2024.0.14.6-preview-242730701 76 9/29/2024
2024.0.14.6-preview-2421703 87 8/29/2024
2024.0.14.6-preview-2421701 74 8/29/2024
2024.0.14.6-preview-2420901 88 8/29/2024
2024.0.14.6-preview-2390101 104 8/26/2024
2024.0.14.6-preview-2381603 105 8/25/2024
2024.0.14.6-preview-2341601 119 8/21/2024
2024.0.14.6-preview-2321602 94 8/20/2024
2024.0.14.6-preview-2190801 135 8/6/2024
2024.0.14.6-preview-2041501 101 7/22/2024
2024.0.14.6-preview-1920603 161 7/10/2024
2024.0.14.6-preview-1920301 75 7/10/2024
2024.0.14.6-preview-1911302 106 7/9/2024
2024.0.14.6-preview-1901001 118 7/8/2024
2024.0.14.6-preview-1900901 97 7/8/2024
2024.0.14.6-preview-1900801 92 7/8/2024
2024.0.14.6-preview-1860304 100 7/4/2024
2024.0.14.5 163 7/1/2024
2024.0.14.5-preview-1811601 95 6/29/2024
2024.0.14.5-preview-1810501 115 6/29/2024
2024.0.14.5-preview-180132 108 6/28/2024
2024.0.14.5-preview-180131 100 6/28/2024
2024.0.14.5-preview-180121 94 6/28/2024
2024.0.14.4 122 6/27/2024
2024.0.14.4-preview-7 94 6/27/2024
2024.0.14.3 94 6/21/2024
2024.0.14.1 105 6/6/2024
2024.0.14.1-preview 89 6/6/2024
2024.0.14-preview-1 97 6/6/2024
2024.0.13.8-preview 94 6/6/2024
2024.0.13.1-preview-0146 91 6/6/2024
2024.0.12.15803-preview-03 76 6/6/2024
2024.0.12.15608 117 6/4/2024
2024.0.12.15515 194 6/3/2024
2024.0.12.15220 109 5/31/2024
2024.0.12.15220-alpha31-240... 83 5/31/2024
2024.0.12.14911 147 5/28/2024
2024.0.12.14910-alpha28-240... 83 5/28/2024
2024.0.12.14823 118 5/27/2024
2024.0.12.14522-alpha7-2405... 103 5/24/2024
2024.0.12.14514-alpha6-2405... 105 5/24/2024
2024.0.12.14511 129 5/24/2024
2024.0.12.14314 133 5/22/2024
2024.0.12.14114 106 5/20/2024
2024.0.12.12815 154 5/7/2024
2024.0.12.12814 127 5/7/2024
2024.0.12.12721 124 5/6/2024
2024.0.12.12702 113 5/5/2024
2024.0.12.12622 147 5/5/2024
2024.0.12.12514 113 5/4/2024
2024.0.12.12512 106 5/4/2024
2024.0.12.12510 129 5/4/2024
2024.0.12.12420 104 5/3/2024
2024.0.12.12319 60 5/2/2024
2024.0.12.12319-rc-2405021801 59 5/2/2024
2024.0.12.12318 73 5/2/2024
2024.0.12.12215 107 5/1/2024
2024.0.12.12011 108 4/29/2024
2024.0.12.11720 132 4/26/2024
2024.0.12.11719 114 4/26/2024
2024.0.12.11621 134 4/25/2024
2024.0.12.11523 116 4/24/2024
2024.0.12.11522 118 4/24/2024
2024.0.12.11417 137 4/23/2024
2024.0.12.11400 150 4/22/2024
2024.0.12.11316 121 4/22/2024
2024.0.11.10220 113 4/11/2024
2024.0.11.10120 108 4/10/2024
2024.0.11.10119 91 4/10/2024
2024.0.11.10115 111 4/10/2024
2024.0.11.9914 146 4/8/2024
2024.0.11.9901 116 4/7/2024
2024.0.11.9823 131 4/7/2024
2024.0.11.9401 125 4/2/2024
2024.0.11.9301 107 4/1/2024
2024.0.11.9206 115 3/31/2024
2024.0.11.9205 113 3/31/2024
2024.0.11.8200 137 3/21/2024
2024.0.11.8122 104 3/21/2024
2024.0.11.8120 111 3/21/2024
2024.0.11.7320 178 3/13/2024
2024.0.11.7316 134 3/13/2024
2024.0.11.7310 125 3/13/2024
2024.0.11 131 3/13/2024
2024.0.10 160 3/3/2024
2024.0.9 113 2/27/2024
2024.0.8 175 2/1/2024
2024.0.7 131 1/26/2024
2024.0.6 121 1/25/2024
2024.0.5 115 1/24/2024
2024.0.4 116 1/24/2024
2024.0.3 114 1/22/2024
2024.0.2 183 1/10/2024
2024.0.1 123 1/9/2024
2024.0.1-alpha-3 101 1/9/2024
2024.0.1-alpha-2 90 1/9/2024
2024.0.1-alpha-1 134 1/3/2024
2024.0.0 184 12/26/2023
2023.0.27 144 12/21/2023
2023.0.26 116 12/21/2023
2023.0.25 147 12/11/2023
2023.0.24 132 12/8/2023
2023.0.23 133 12/6/2023
2023.0.21 134 12/4/2023
2023.0.20 164 11/27/2023
2023.0.19 127 11/20/2023
2023.0.18 164 10/25/2023
2023.0.17 194 10/22/2023
2023.0.16 167 10/16/2023
2023.0.16-alpha-1 88 10/16/2023
2023.0.15 152 10/14/2023
2023.0.14 119 10/14/2023
2023.0.13 137 10/14/2023
2023.0.12 131 10/14/2023
2023.0.11 122 10/10/2023
2023.0.10 135 10/9/2023
2023.0.9 157 8/16/2023
2023.0.8 154 8/15/2023
2023.0.8-alpha-2 215 5/31/2023
2023.0.7 147 5/12/2023
2023.0.6 171 5/10/2023
2023.0.5 143 5/7/2023
2023.0.4 168 4/22/2023
2023.0.3 201 4/19/2023
2023.0.2 186 4/6/2023
2023.0.1 197 3/13/2023
2022.9.0 294 10/15/2022