DotNetBrightener.TimeBasedOtp 2024.0.13.8-preview

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.13.8-preview
                    
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.13.8-preview
                    
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.13.8-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetBrightener.TimeBasedOtp" Version="2024.0.13.8-preview" />
                    
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.13.8-preview
                    
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.13.8-preview"
                    
#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.13.8-preview
                    
#: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.13.8-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.13.8-preview&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.10-preview-628 199 11/20/2025
2025.0.10-preview-605 223 11/17/2025
2025.0.10-preview-602 226 11/17/2025
2025.0.10-preview-581 269 11/11/2025
2025.0.10-preview-559 169 10/29/2025
2025.0.10-preview-557 166 10/27/2025
2025.0.9 170 10/26/2025
2025.0.9-preview-553 154 10/26/2025
2025.0.9-preview-539 117 10/12/2025
2025.0.9-preview-535 160 10/8/2025
2025.0.9-preview-509 184 10/2/2025
2025.0.9-preview-508 165 10/2/2025
2025.0.9-preview-487 186 9/29/2025
2025.0.9-preview-481 167 9/29/2025
2025.0.9-preview-473 155 9/28/2025
2025.0.8 180 9/23/2025
2025.0.6 199 9/22/2025
2025.0.6-preview-455 171 9/22/2025
2025.0.6-preview-454 287 9/17/2025
2025.0.6-preview-441 138 9/14/2025
2025.0.6-preview-440 130 9/14/2025
2025.0.6-preview-406 157 9/2/2025
2025.0.6-preview-401 160 9/2/2025
2025.0.6-preview-400 149 9/2/2025
2025.0.6-preview-369 210 8/27/2025
2025.0.6-preview-368 193 8/27/2025
2025.0.6-preview-334 169 8/18/2025
2025.0.6-preview-333 104 7/27/2025
2025.0.6-preview-332 490 7/24/2025
2025.0.6-preview-331 484 7/24/2025
2025.0.6-preview-328 492 7/24/2025
2025.0.6-preview-327 347 7/21/2025
2025.0.6-preview-326 335 7/21/2025
2025.0.6-preview-325 248 7/20/2025
2025.0.6-preview-324 252 7/20/2025
2025.0.6-preview-322 252 7/20/2025
2025.0.6-preview-321 250 7/19/2025
2025.0.6-preview-320 253 7/19/2025
2025.0.6-preview-319 156 7/17/2025
2025.0.6-preview-317 172 7/17/2025
2025.0.6-preview-316 168 7/17/2025
2025.0.6-preview-315 154 7/17/2025
2025.0.6-preview-314 169 7/17/2025
2025.0.6-preview-313 145 7/17/2025
2025.0.6-preview-312 172 7/16/2025
2025.0.5 200 7/10/2025
2025.0.5-preview-307 81 7/5/2025
2025.0.4 109 7/5/2025
2025.0.4-preview-305 95 7/4/2025
2025.0.4-preview-304 157 7/1/2025
2025.0.4-preview-299 136 5/31/2025
2025.0.4-preview-298 113 5/30/2025
2025.0.4-preview-296 151 5/30/2025
2025.0.4-preview-295 177 5/29/2025
2025.0.4-preview-293 168 5/26/2025
2025.0.4-preview-292 163 5/26/2025
2025.0.3 152 2/10/2025
2025.0.3-preview-288 131 2/10/2025
2025.0.2 157 1/21/2025
2025.0.2-preview-278 118 1/21/2025
2025.0.2-preview-277 131 12/16/2024
2025.0.1-rc-243301701 365 11/25/2024
2024.0.14.6 159 11/25/2024
2024.0.14.6-rc-243031001 183 10/29/2024
2024.0.14.6-rc-243030701 113 10/29/2024
2024.0.14.6-rc-242840501 126 10/10/2024
2024.0.14.6-rc-242820305 118 10/8/2024
2024.0.14.6-rc-242771401 186 10/3/2024
2024.0.14.6-rc-242770501 122 10/3/2024
2024.0.14.6-rc-242770201 114 10/3/2024
2024.0.14.6-rc-242761801 118 10/2/2024
2024.0.14.6-rc-242761601 119 10/2/2024
2024.0.14.6-rc-242761501 118 10/2/2024
2024.0.14.6-rc-242761401 130 10/2/2024
2024.0.14.6-rc-242760701 131 10/2/2024
2024.0.14.6-rc-242751002 115 10/1/2024
2024.0.14.6-rc-242750901 127 10/1/2024
2024.0.14.6-rc-242750502 111 10/1/2024
2024.0.14.6-rc-242750201 130 10/1/2024
2024.0.14.6-rc-242741501 121 9/30/2024
2024.0.14.6-rc-242730701 134 9/29/2024
2024.0.14.6-preview-2730501 123 9/29/2024
2024.0.14.6-preview-2701501 126 9/26/2024
2024.0.14.6-preview-2620901 166 9/18/2024
2024.0.14.6-preview-2570701 129 9/13/2024
2024.0.14.6-preview-2510703 139 9/7/2024
2024.0.14.6-preview-2480501 147 9/4/2024
2024.0.14.6-preview-2430401 161 8/30/2024
2024.0.14.6-preview-242730701 119 9/29/2024
2024.0.14.6-preview-2421703 128 8/29/2024
2024.0.14.6-preview-2421701 97 8/29/2024
2024.0.14.6-preview-2420901 122 8/29/2024
2024.0.14.6-preview-2390101 141 8/26/2024
2024.0.14.6-preview-2381603 144 8/25/2024
2024.0.14.6-preview-2341601 150 8/21/2024
2024.0.14.6-preview-2321602 128 8/20/2024
2024.0.14.6-preview-2190801 172 8/6/2024
2024.0.14.6-preview-2041501 137 7/22/2024
2024.0.14.6-preview-1920603 212 7/10/2024
2024.0.14.6-preview-1920301 124 7/10/2024
2024.0.14.6-preview-1911302 142 7/9/2024
2024.0.14.6-preview-1901001 155 7/8/2024
2024.0.14.6-preview-1900901 144 7/8/2024
2024.0.14.6-preview-1900801 126 7/8/2024
2024.0.14.6-preview-1860304 126 7/4/2024
2024.0.14.5 235 7/1/2024
2024.0.14.5-preview-1811601 140 6/29/2024
2024.0.14.5-preview-1810501 166 6/29/2024
2024.0.14.5-preview-180132 145 6/28/2024
2024.0.14.5-preview-180131 138 6/28/2024
2024.0.14.5-preview-180121 130 6/28/2024
2024.0.14.4 196 6/27/2024
2024.0.14.4-preview-7 142 6/27/2024
2024.0.14.3 157 6/21/2024
2024.0.14.1 180 6/6/2024
2024.0.14.1-preview 123 6/6/2024
2024.0.14-preview-1 141 6/6/2024
2024.0.13.8-preview 140 6/6/2024
2024.0.13.1-preview-0146 137 6/6/2024
2024.0.12.15803-preview-03 123 6/6/2024
2024.0.12.15608 184 6/4/2024
2024.0.12.15515 264 6/3/2024
2024.0.12.15220 172 5/31/2024
2024.0.12.15220-alpha31-240... 126 5/31/2024
2024.0.12.14911 224 5/28/2024
2024.0.12.14910-alpha28-240... 137 5/28/2024
2024.0.12.14823 178 5/27/2024
2024.0.12.14522-alpha7-2405... 139 5/24/2024
2024.0.12.14514-alpha6-2405... 133 5/24/2024
2024.0.12.14511 182 5/24/2024
2024.0.12.14314 205 5/22/2024
2024.0.12.14114 176 5/20/2024
2024.0.12.12815 218 5/7/2024
2024.0.12.12814 191 5/7/2024
2024.0.12.12721 194 5/6/2024
2024.0.12.12702 173 5/5/2024
2024.0.12.12622 209 5/5/2024
2024.0.12.12514 188 5/4/2024
2024.0.12.12512 178 5/4/2024
2024.0.12.12510 202 5/4/2024
2024.0.12.12420 172 5/3/2024
2024.0.12.12319 130 5/2/2024
2024.0.12.12319-rc-2405021801 108 5/2/2024
2024.0.12.12318 160 5/2/2024
2024.0.12.12215 182 5/1/2024
2024.0.12.12011 178 4/29/2024
2024.0.12.11720 188 4/26/2024
2024.0.12.11719 187 4/26/2024
2024.0.12.11621 192 4/25/2024
2024.0.12.11523 180 4/24/2024
2024.0.12.11522 176 4/24/2024
2024.0.12.11417 198 4/23/2024
2024.0.12.11400 220 4/22/2024
2024.0.12.11316 186 4/22/2024
2024.0.11.10220 174 4/11/2024
2024.0.11.10120 166 4/10/2024
2024.0.11.10119 149 4/10/2024
2024.0.11.10115 183 4/10/2024
2024.0.11.9914 207 4/8/2024
2024.0.11.9901 180 4/7/2024
2024.0.11.9823 189 4/7/2024
2024.0.11.9401 195 4/2/2024
2024.0.11.9301 172 4/1/2024
2024.0.11.9206 176 3/31/2024
2024.0.11.9205 174 3/31/2024
2024.0.11.8200 198 3/21/2024
2024.0.11.8122 161 3/21/2024
2024.0.11.8120 170 3/21/2024
2024.0.11.7320 246 3/13/2024
2024.0.11.7316 202 3/13/2024
2024.0.11.7310 196 3/13/2024
2024.0.11 193 3/13/2024
2024.0.10 226 3/3/2024
2024.0.9 173 2/27/2024
2024.0.8 231 2/1/2024
2024.0.7 192 1/26/2024
2024.0.6 187 1/25/2024
2024.0.5 175 1/24/2024
2024.0.4 175 1/24/2024
2024.0.3 180 1/22/2024
2024.0.2 238 1/10/2024
2024.0.1 183 1/9/2024
2024.0.1-alpha-3 137 1/9/2024
2024.0.1-alpha-2 127 1/9/2024
2024.0.1-alpha-1 174 1/3/2024
2024.0.0 243 12/26/2023
2023.0.27 199 12/21/2023
2023.0.26 179 12/21/2023
2023.0.25 204 12/11/2023
2023.0.24 185 12/8/2023
2023.0.23 164 12/6/2023
2023.0.21 169 12/4/2023
2023.0.20 205 11/27/2023
2023.0.19 160 11/20/2023
2023.0.18 206 10/25/2023
2023.0.17 232 10/22/2023
2023.0.16 209 10/16/2023
2023.0.16-alpha-1 142 10/16/2023
2023.0.15 193 10/14/2023
2023.0.14 161 10/14/2023
2023.0.13 180 10/14/2023
2023.0.12 172 10/14/2023
2023.0.11 160 10/10/2023
2023.0.10 176 10/9/2023
2023.0.9 214 8/16/2023
2023.0.8 214 8/15/2023
2023.0.8-alpha-2 291 5/31/2023
2023.0.7 234 5/12/2023
2023.0.6 402 5/10/2023
2023.0.5 237 5/7/2023
2023.0.4 258 4/22/2023
2023.0.3 288 4/19/2023
2023.0.2 266 4/6/2023
2023.0.1 279 3/13/2023
2022.9.0 388 10/15/2022