DotNetBrightener.TimeBasedOtp 2025.0.6-preview-369

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-369
                    
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2025.0.6-preview-369
                    
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-369" />
                    
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-369" />
                    
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-369
                    
#r "nuget: DotNetBrightener.TimeBasedOtp, 2025.0.6-preview-369"
                    
#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-369
                    
#: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-369&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2025.0.6-preview-369&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 148 10/29/2025
2025.0.10-preview-557 151 10/27/2025
2025.0.9 151 10/26/2025
2025.0.9-preview-553 142 10/26/2025
2025.0.9-preview-539 113 10/12/2025
2025.0.9-preview-535 156 10/8/2025
2025.0.9-preview-509 180 10/2/2025
2025.0.9-preview-508 161 10/2/2025
2025.0.9-preview-487 183 9/29/2025
2025.0.9-preview-481 162 9/29/2025
2025.0.9-preview-473 151 9/28/2025
2025.0.8 173 9/23/2025
2025.0.6 193 9/22/2025
2025.0.6-preview-455 167 9/22/2025
2025.0.6-preview-454 281 9/17/2025
2025.0.6-preview-441 134 9/14/2025
2025.0.6-preview-440 127 9/14/2025
2025.0.6-preview-406 154 9/2/2025
2025.0.6-preview-401 157 9/2/2025
2025.0.6-preview-400 146 9/2/2025
2025.0.6-preview-369 205 8/27/2025
2025.0.6-preview-368 189 8/27/2025
2025.0.6-preview-334 165 8/18/2025
2025.0.6-preview-333 99 7/27/2025
2025.0.6-preview-332 488 7/24/2025
2025.0.6-preview-331 481 7/24/2025
2025.0.6-preview-328 489 7/24/2025
2025.0.6-preview-327 344 7/21/2025
2025.0.6-preview-326 332 7/21/2025
2025.0.6-preview-325 244 7/20/2025
2025.0.6-preview-324 249 7/20/2025
2025.0.6-preview-322 250 7/20/2025
2025.0.6-preview-321 248 7/19/2025
2025.0.6-preview-320 251 7/19/2025
2025.0.6-preview-319 154 7/17/2025
2025.0.6-preview-317 170 7/17/2025
2025.0.6-preview-316 163 7/17/2025
2025.0.6-preview-315 151 7/17/2025
2025.0.6-preview-314 167 7/17/2025
2025.0.6-preview-313 142 7/17/2025
2025.0.6-preview-312 170 7/16/2025
2025.0.5 195 7/10/2025
2025.0.5-preview-307 79 7/5/2025
2025.0.4 104 7/5/2025
2025.0.4-preview-305 93 7/4/2025
2025.0.4-preview-304 155 7/1/2025
2025.0.4-preview-299 135 5/31/2025
2025.0.4-preview-298 111 5/30/2025
2025.0.4-preview-296 149 5/30/2025
2025.0.4-preview-295 175 5/29/2025
2025.0.4-preview-293 166 5/26/2025
2025.0.4-preview-292 161 5/26/2025
2025.0.3 149 2/10/2025
2025.0.3-preview-288 130 2/10/2025
2025.0.2 154 1/21/2025
2025.0.2-preview-278 117 1/21/2025
2025.0.2-preview-277 130 12/16/2024
2025.0.1-rc-243301701 364 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 185 10/3/2024
2024.0.14.6-rc-242770501 121 10/3/2024
2024.0.14.6-rc-242770201 112 10/3/2024
2024.0.14.6-rc-242761801 117 10/2/2024
2024.0.14.6-rc-242761601 118 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 129 10/2/2024
2024.0.14.6-rc-242751002 114 10/1/2024
2024.0.14.6-rc-242750901 126 10/1/2024
2024.0.14.6-rc-242750502 110 10/1/2024
2024.0.14.6-rc-242750201 128 10/1/2024
2024.0.14.6-rc-242741501 120 9/30/2024
2024.0.14.6-rc-242730701 133 9/29/2024
2024.0.14.6-preview-2730501 122 9/29/2024
2024.0.14.6-preview-2701501 125 9/26/2024
2024.0.14.6-preview-2620901 164 9/18/2024
2024.0.14.6-preview-2570701 128 9/13/2024
2024.0.14.6-preview-2510703 138 9/7/2024
2024.0.14.6-preview-2480501 146 9/4/2024
2024.0.14.6-preview-2430401 159 8/30/2024
2024.0.14.6-preview-242730701 117 9/29/2024
2024.0.14.6-preview-2421703 127 8/29/2024
2024.0.14.6-preview-2421701 96 8/29/2024
2024.0.14.6-preview-2420901 121 8/29/2024
2024.0.14.6-preview-2390101 140 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 136 7/22/2024
2024.0.14.6-preview-1920603 211 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 139 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 193 6/27/2024
2024.0.14.4-preview-7 141 6/27/2024
2024.0.14.3 153 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 168 5/31/2024
2024.0.12.15220-alpha31-240... 125 5/31/2024
2024.0.12.14911 221 5/28/2024
2024.0.12.14910-alpha28-240... 136 5/28/2024
2024.0.12.14823 174 5/27/2024
2024.0.12.14522-alpha7-2405... 138 5/24/2024
2024.0.12.14514-alpha6-2405... 132 5/24/2024
2024.0.12.14511 179 5/24/2024
2024.0.12.14314 202 5/22/2024
2024.0.12.14114 173 5/20/2024
2024.0.12.12815 215 5/7/2024
2024.0.12.12814 188 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 179 5/1/2024
2024.0.12.12011 175 4/29/2024
2024.0.12.11720 185 4/26/2024
2024.0.12.11719 184 4/26/2024
2024.0.12.11621 189 4/25/2024
2024.0.12.11523 177 4/24/2024
2024.0.12.11522 173 4/24/2024
2024.0.12.11417 194 4/23/2024
2024.0.12.11400 217 4/22/2024
2024.0.12.11316 183 4/22/2024
2024.0.11.10220 170 4/11/2024
2024.0.11.10120 163 4/10/2024
2024.0.11.10119 146 4/10/2024
2024.0.11.10115 180 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 192 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 195 3/21/2024
2024.0.11.8122 158 3/21/2024
2024.0.11.8120 167 3/21/2024
2024.0.11.7320 243 3/13/2024
2024.0.11.7316 199 3/13/2024
2024.0.11.7310 193 3/13/2024
2024.0.11 189 3/13/2024
2024.0.10 223 3/3/2024
2024.0.9 171 2/27/2024
2024.0.8 228 2/1/2024
2024.0.7 189 1/26/2024
2024.0.6 184 1/25/2024
2024.0.5 172 1/24/2024
2024.0.4 172 1/24/2024
2024.0.3 177 1/22/2024
2024.0.2 235 1/10/2024
2024.0.1 180 1/9/2024
2024.0.1-alpha-3 136 1/9/2024
2024.0.1-alpha-2 126 1/9/2024
2024.0.1-alpha-1 173 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 201 12/11/2023
2023.0.24 182 12/8/2023
2023.0.23 163 12/6/2023
2023.0.21 168 12/4/2023
2023.0.20 203 11/27/2023
2023.0.19 159 11/20/2023
2023.0.18 203 10/25/2023
2023.0.17 230 10/22/2023
2023.0.16 208 10/16/2023
2023.0.16-alpha-1 140 10/16/2023
2023.0.15 192 10/14/2023
2023.0.14 160 10/14/2023
2023.0.13 179 10/14/2023
2023.0.12 171 10/14/2023
2023.0.11 159 10/10/2023
2023.0.10 174 10/9/2023
2023.0.9 213 8/16/2023
2023.0.8 212 8/15/2023
2023.0.8-alpha-2 287 5/31/2023
2023.0.7 229 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 285 4/19/2023
2023.0.2 263 4/6/2023
2023.0.1 276 3/13/2023
2022.9.0 383 10/15/2022