DotNetBrightener.TimeBasedOtp 2025.0.6-preview-327

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