DotNetBrightener.TimeBasedOtp 2024.0.12.14910-alpha28-24052810

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.14910-alpha28-24052810
                    
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.12.14910-alpha28-24052810
                    
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.14910-alpha28-24052810" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetBrightener.TimeBasedOtp" Version="2024.0.12.14910-alpha28-24052810" />
                    
Directory.Packages.props
<PackageReference Include="DotNetBrightener.TimeBasedOtp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotNetBrightener.TimeBasedOtp --version 2024.0.12.14910-alpha28-24052810
                    
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.12.14910-alpha28-24052810"
                    
#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.
#:package DotNetBrightener.TimeBasedOtp@2024.0.12.14910-alpha28-24052810
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.12.14910-alpha28-24052810&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.12.14910-alpha28-24052810&prerelease
                    
Install as a Cake Tool

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.8 38 9/23/2025
2025.0.6 48 9/22/2025
2025.0.6-preview-455 40 9/22/2025
2025.0.6-preview-454 264 9/17/2025
2025.0.6-preview-441 110 9/14/2025
2025.0.6-preview-440 111 9/14/2025
2025.0.6-preview-406 139 9/2/2025
2025.0.6-preview-401 132 9/2/2025
2025.0.6-preview-400 130 9/2/2025
2025.0.6-preview-369 180 8/27/2025
2025.0.6-preview-368 175 8/27/2025
2025.0.6-preview-334 152 8/18/2025
2025.0.6-preview-333 90 7/27/2025
2025.0.6-preview-332 462 7/24/2025
2025.0.6-preview-331 468 7/24/2025
2025.0.6-preview-328 466 7/24/2025
2025.0.6-preview-327 329 7/21/2025
2025.0.6-preview-326 320 7/21/2025
2025.0.6-preview-325 231 7/20/2025
2025.0.6-preview-324 225 7/20/2025
2025.0.6-preview-322 232 7/20/2025
2025.0.6-preview-321 234 7/19/2025
2025.0.6-preview-320 226 7/19/2025
2025.0.6-preview-319 141 7/17/2025
2025.0.6-preview-317 134 7/17/2025
2025.0.6-preview-316 136 7/17/2025
2025.0.6-preview-315 137 7/17/2025
2025.0.6-preview-314 140 7/17/2025
2025.0.6-preview-313 139 7/17/2025
2025.0.6-preview-312 145 7/16/2025
2025.0.5 168 7/10/2025
2025.0.5-preview-307 64 7/5/2025
2025.0.4 81 7/5/2025
2025.0.4-preview-305 80 7/4/2025
2025.0.4-preview-304 141 7/1/2025
2025.0.4-preview-299 119 5/31/2025
2025.0.4-preview-298 99 5/30/2025
2025.0.4-preview-296 135 5/30/2025
2025.0.4-preview-295 152 5/29/2025
2025.0.4-preview-293 145 5/26/2025
2025.0.4-preview-292 149 5/26/2025
2025.0.3 144 2/10/2025
2025.0.3-preview-288 109 2/10/2025
2025.0.2 137 1/21/2025
2025.0.2-preview-278 94 1/21/2025
2025.0.2-preview-277 106 12/16/2024
2025.0.1-rc-243301701 341 11/25/2024
2024.0.14.6 140 11/25/2024
2024.0.14.6-rc-243031001 158 10/29/2024
2024.0.14.6-rc-243030701 109 10/29/2024
2024.0.14.6-rc-242840501 102 10/10/2024
2024.0.14.6-rc-242820305 105 10/8/2024
2024.0.14.6-rc-242771401 173 10/3/2024
2024.0.14.6-rc-242770501 99 10/3/2024
2024.0.14.6-rc-242770201 109 10/3/2024
2024.0.14.6-rc-242761801 105 10/2/2024
2024.0.14.6-rc-242761601 105 10/2/2024
2024.0.14.6-rc-242761501 104 10/2/2024
2024.0.14.6-rc-242761401 115 10/2/2024
2024.0.14.6-rc-242760701 117 10/2/2024
2024.0.14.6-rc-242751002 108 10/1/2024
2024.0.14.6-rc-242750901 112 10/1/2024
2024.0.14.6-rc-242750502 98 10/1/2024
2024.0.14.6-rc-242750201 105 10/1/2024
2024.0.14.6-rc-242741501 106 9/30/2024
2024.0.14.6-rc-242730701 119 9/29/2024
2024.0.14.6-preview-2730501 110 9/29/2024
2024.0.14.6-preview-2701501 111 9/26/2024
2024.0.14.6-preview-2620901 151 9/18/2024
2024.0.14.6-preview-2570701 113 9/13/2024
2024.0.14.6-preview-2510703 135 9/7/2024
2024.0.14.6-preview-2480501 132 9/4/2024
2024.0.14.6-preview-2430401 137 8/30/2024
2024.0.14.6-preview-242730701 105 9/29/2024
2024.0.14.6-preview-2421703 110 8/29/2024
2024.0.14.6-preview-2421701 94 8/29/2024
2024.0.14.6-preview-2420901 109 8/29/2024
2024.0.14.6-preview-2390101 128 8/26/2024
2024.0.14.6-preview-2381603 128 8/25/2024
2024.0.14.6-preview-2341601 138 8/21/2024
2024.0.14.6-preview-2321602 116 8/20/2024
2024.0.14.6-preview-2190801 158 8/6/2024
2024.0.14.6-preview-2041501 123 7/22/2024
2024.0.14.6-preview-1920603 185 7/10/2024
2024.0.14.6-preview-1920301 98 7/10/2024
2024.0.14.6-preview-1911302 128 7/9/2024
2024.0.14.6-preview-1901001 141 7/8/2024
2024.0.14.6-preview-1900901 117 7/8/2024
2024.0.14.6-preview-1900801 113 7/8/2024
2024.0.14.6-preview-1860304 123 7/4/2024
2024.0.14.5 206 7/1/2024
2024.0.14.5-preview-1811601 117 6/29/2024
2024.0.14.5-preview-1810501 141 6/29/2024
2024.0.14.5-preview-180132 130 6/28/2024
2024.0.14.5-preview-180131 124 6/28/2024
2024.0.14.5-preview-180121 117 6/28/2024
2024.0.14.4 167 6/27/2024
2024.0.14.4-preview-7 116 6/27/2024
2024.0.14.3 137 6/21/2024
2024.0.14.1 151 6/6/2024
2024.0.14.1-preview 109 6/6/2024
2024.0.14-preview-1 117 6/6/2024
2024.0.13.8-preview 115 6/6/2024
2024.0.13.1-preview-0146 113 6/6/2024
2024.0.12.15803-preview-03 100 6/6/2024
2024.0.12.15608 156 6/4/2024
2024.0.12.15515 236 6/3/2024
2024.0.12.15220 152 5/31/2024
2024.0.12.15220-alpha31-240... 106 5/31/2024
2024.0.12.14911 195 5/28/2024
2024.0.12.14910-alpha28-240... 124 5/28/2024
2024.0.12.14823 158 5/27/2024
2024.0.12.14522-alpha7-2405... 126 5/24/2024
2024.0.12.14514-alpha6-2405... 127 5/24/2024
2024.0.12.14511 171 5/24/2024
2024.0.12.14314 178 5/22/2024
2024.0.12.14114 149 5/20/2024
2024.0.12.12815 198 5/7/2024
2024.0.12.12814 173 5/7/2024
2024.0.12.12721 167 5/6/2024
2024.0.12.12702 154 5/5/2024
2024.0.12.12622 190 5/5/2024
2024.0.12.12514 160 5/4/2024
2024.0.12.12512 150 5/4/2024
2024.0.12.12510 172 5/4/2024
2024.0.12.12420 154 5/3/2024
2024.0.12.12319 112 5/2/2024
2024.0.12.12319-rc-2405021801 84 5/2/2024
2024.0.12.12318 120 5/2/2024
2024.0.12.12215 153 5/1/2024
2024.0.12.12011 156 4/29/2024
2024.0.12.11720 170 4/26/2024
2024.0.12.11719 158 4/26/2024
2024.0.12.11621 175 4/25/2024
2024.0.12.11523 160 4/24/2024
2024.0.12.11522 159 4/24/2024
2024.0.12.11417 180 4/23/2024
2024.0.12.11400 202 4/22/2024
2024.0.12.11316 168 4/22/2024
2024.0.11.10220 155 4/11/2024
2024.0.11.10120 148 4/10/2024
2024.0.11.10119 132 4/10/2024
2024.0.11.10115 155 4/10/2024
2024.0.11.9914 190 4/8/2024
2024.0.11.9901 163 4/7/2024
2024.0.11.9823 172 4/7/2024
2024.0.11.9401 167 4/2/2024
2024.0.11.9301 145 4/1/2024
2024.0.11.9206 158 3/31/2024
2024.0.11.9205 155 3/31/2024
2024.0.11.8200 180 3/21/2024
2024.0.11.8122 143 3/21/2024
2024.0.11.8120 151 3/21/2024
2024.0.11.7320 225 3/13/2024
2024.0.11.7316 172 3/13/2024
2024.0.11.7310 167 3/13/2024
2024.0.11 172 3/13/2024
2024.0.10 204 3/3/2024
2024.0.9 154 2/27/2024
2024.0.8 212 2/1/2024
2024.0.7 173 1/26/2024
2024.0.6 159 1/25/2024
2024.0.5 155 1/24/2024
2024.0.4 154 1/24/2024
2024.0.3 153 1/22/2024
2024.0.2 221 1/10/2024
2024.0.1 159 1/9/2024
2024.0.1-alpha-3 123 1/9/2024
2024.0.1-alpha-2 113 1/9/2024
2024.0.1-alpha-1 151 1/3/2024
2024.0.0 225 12/26/2023
2023.0.27 182 12/21/2023
2023.0.26 159 12/21/2023
2023.0.25 186 12/11/2023
2023.0.24 168 12/8/2023
2023.0.23 151 12/6/2023
2023.0.21 154 12/4/2023
2023.0.20 189 11/27/2023
2023.0.19 147 11/20/2023
2023.0.18 190 10/25/2023
2023.0.17 218 10/22/2023
2023.0.16 196 10/16/2023
2023.0.16-alpha-1 117 10/16/2023
2023.0.15 178 10/14/2023
2023.0.14 145 10/14/2023
2023.0.13 165 10/14/2023
2023.0.12 158 10/14/2023
2023.0.11 147 10/10/2023
2023.0.10 161 10/9/2023
2023.0.9 200 8/16/2023
2023.0.8 200 8/15/2023
2023.0.8-alpha-2 269 5/31/2023
2023.0.7 209 5/12/2023
2023.0.6 357 5/10/2023
2023.0.5 203 5/7/2023
2023.0.4 226 4/22/2023
2023.0.3 261 4/19/2023
2023.0.2 244 4/6/2023
2023.0.1 255 3/13/2023
2022.9.0 358 10/15/2022