DotNetBrightener.TimeBasedOtp 2024.0.14.5-preview-180121

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.14.5-preview-180121
                    
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.14.5-preview-180121
                    
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.14.5-preview-180121" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetBrightener.TimeBasedOtp" Version="2024.0.14.5-preview-180121" />
                    
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.14.5-preview-180121
                    
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.14.5-preview-180121"
                    
#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.
#addin nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.14.5-preview-180121&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.14.5-preview-180121&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.4-preview-304 11 7/1/2025
2025.0.4-preview-299 102 5/31/2025
2025.0.4-preview-298 84 5/30/2025
2025.0.4-preview-296 120 5/30/2025
2025.0.4-preview-295 136 5/29/2025
2025.0.4-preview-293 132 5/26/2025
2025.0.4-preview-292 135 5/26/2025
2025.0.3 120 2/10/2025
2025.0.3-preview-288 98 2/10/2025
2025.0.2 114 1/21/2025
2025.0.2-preview-278 83 1/21/2025
2025.0.2-preview-277 93 12/16/2024
2025.0.1-rc-243301701 329 11/25/2024
2024.0.14.6 118 11/25/2024
2024.0.14.6-rc-243031001 146 10/29/2024
2024.0.14.6-rc-243030701 97 10/29/2024
2024.0.14.6-rc-242840501 92 10/10/2024
2024.0.14.6-rc-242820305 94 10/8/2024
2024.0.14.6-rc-242771401 163 10/3/2024
2024.0.14.6-rc-242770501 88 10/3/2024
2024.0.14.6-rc-242770201 97 10/3/2024
2024.0.14.6-rc-242761801 95 10/2/2024
2024.0.14.6-rc-242761601 93 10/2/2024
2024.0.14.6-rc-242761501 90 10/2/2024
2024.0.14.6-rc-242761401 104 10/2/2024
2024.0.14.6-rc-242760701 106 10/2/2024
2024.0.14.6-rc-242751002 97 10/1/2024
2024.0.14.6-rc-242750901 101 10/1/2024
2024.0.14.6-rc-242750502 88 10/1/2024
2024.0.14.6-rc-242750201 95 10/1/2024
2024.0.14.6-rc-242741501 96 9/30/2024
2024.0.14.6-rc-242730701 107 9/29/2024
2024.0.14.6-preview-2730501 97 9/29/2024
2024.0.14.6-preview-2701501 101 9/26/2024
2024.0.14.6-preview-2620901 138 9/18/2024
2024.0.14.6-preview-2570701 103 9/13/2024
2024.0.14.6-preview-2510703 125 9/7/2024
2024.0.14.6-preview-2480501 121 9/4/2024
2024.0.14.6-preview-2430401 127 8/30/2024
2024.0.14.6-preview-242730701 95 9/29/2024
2024.0.14.6-preview-2421703 98 8/29/2024
2024.0.14.6-preview-2421701 82 8/29/2024
2024.0.14.6-preview-2420901 98 8/29/2024
2024.0.14.6-preview-2390101 118 8/26/2024
2024.0.14.6-preview-2381603 117 8/25/2024
2024.0.14.6-preview-2341601 127 8/21/2024
2024.0.14.6-preview-2321602 106 8/20/2024
2024.0.14.6-preview-2190801 147 8/6/2024
2024.0.14.6-preview-2041501 113 7/22/2024
2024.0.14.6-preview-1920603 173 7/10/2024
2024.0.14.6-preview-1920301 87 7/10/2024
2024.0.14.6-preview-1911302 117 7/9/2024
2024.0.14.6-preview-1901001 131 7/8/2024
2024.0.14.6-preview-1900901 107 7/8/2024
2024.0.14.6-preview-1900801 103 7/8/2024
2024.0.14.6-preview-1860304 110 7/4/2024
2024.0.14.5 186 7/1/2024
2024.0.14.5-preview-1811601 107 6/29/2024
2024.0.14.5-preview-1810501 131 6/29/2024
2024.0.14.5-preview-180132 119 6/28/2024
2024.0.14.5-preview-180131 114 6/28/2024
2024.0.14.5-preview-180121 105 6/28/2024
2024.0.14.4 146 6/27/2024
2024.0.14.4-preview-7 105 6/27/2024
2024.0.14.3 115 6/21/2024
2024.0.14.1 129 6/6/2024
2024.0.14.1-preview 99 6/6/2024
2024.0.14-preview-1 106 6/6/2024
2024.0.13.8-preview 104 6/6/2024
2024.0.13.1-preview-0146 101 6/6/2024
2024.0.12.15803-preview-03 90 6/6/2024
2024.0.12.15608 135 6/4/2024
2024.0.12.15515 215 6/3/2024
2024.0.12.15220 130 5/31/2024
2024.0.12.15220-alpha31-240... 95 5/31/2024
2024.0.12.14911 173 5/28/2024
2024.0.12.14910-alpha28-240... 111 5/28/2024
2024.0.12.14823 137 5/27/2024
2024.0.12.14522-alpha7-2405... 113 5/24/2024
2024.0.12.14514-alpha6-2405... 116 5/24/2024
2024.0.12.14511 150 5/24/2024
2024.0.12.14314 155 5/22/2024
2024.0.12.14114 128 5/20/2024
2024.0.12.12815 177 5/7/2024
2024.0.12.12814 152 5/7/2024
2024.0.12.12721 145 5/6/2024
2024.0.12.12702 134 5/5/2024
2024.0.12.12622 169 5/5/2024
2024.0.12.12514 139 5/4/2024
2024.0.12.12512 129 5/4/2024
2024.0.12.12510 152 5/4/2024
2024.0.12.12420 133 5/3/2024
2024.0.12.12319 90 5/2/2024
2024.0.12.12319-rc-2405021801 73 5/2/2024
2024.0.12.12318 98 5/2/2024
2024.0.12.12215 132 5/1/2024
2024.0.12.12011 134 4/29/2024
2024.0.12.11720 151 4/26/2024
2024.0.12.11719 136 4/26/2024
2024.0.12.11621 154 4/25/2024
2024.0.12.11523 139 4/24/2024
2024.0.12.11522 139 4/24/2024
2024.0.12.11417 160 4/23/2024
2024.0.12.11400 180 4/22/2024
2024.0.12.11316 147 4/22/2024
2024.0.11.10220 135 4/11/2024
2024.0.11.10120 127 4/10/2024
2024.0.11.10119 110 4/10/2024
2024.0.11.10115 134 4/10/2024
2024.0.11.9914 170 4/8/2024
2024.0.11.9901 143 4/7/2024
2024.0.11.9823 151 4/7/2024
2024.0.11.9401 147 4/2/2024
2024.0.11.9301 124 4/1/2024
2024.0.11.9206 137 3/31/2024
2024.0.11.9205 135 3/31/2024
2024.0.11.8200 159 3/21/2024
2024.0.11.8122 122 3/21/2024
2024.0.11.8120 130 3/21/2024
2024.0.11.7320 207 3/13/2024
2024.0.11.7316 152 3/13/2024
2024.0.11.7310 148 3/13/2024
2024.0.11 152 3/13/2024
2024.0.10 182 3/3/2024
2024.0.9 134 2/27/2024
2024.0.8 192 2/1/2024
2024.0.7 154 1/26/2024
2024.0.6 139 1/25/2024
2024.0.5 135 1/24/2024
2024.0.4 135 1/24/2024
2024.0.3 133 1/22/2024
2024.0.2 200 1/10/2024
2024.0.1 139 1/9/2024
2024.0.1-alpha-3 112 1/9/2024
2024.0.1-alpha-2 104 1/9/2024
2024.0.1-alpha-1 143 1/3/2024
2024.0.0 205 12/26/2023
2023.0.27 162 12/21/2023
2023.0.26 140 12/21/2023
2023.0.25 168 12/11/2023
2023.0.24 150 12/8/2023
2023.0.23 142 12/6/2023
2023.0.21 146 12/4/2023
2023.0.20 179 11/27/2023
2023.0.19 137 11/20/2023
2023.0.18 177 10/25/2023
2023.0.17 205 10/22/2023
2023.0.16 182 10/16/2023
2023.0.16-alpha-1 103 10/16/2023
2023.0.15 162 10/14/2023
2023.0.14 131 10/14/2023
2023.0.13 151 10/14/2023
2023.0.12 145 10/14/2023
2023.0.11 132 10/10/2023
2023.0.10 147 10/9/2023
2023.0.9 173 8/16/2023
2023.0.8 171 8/15/2023
2023.0.8-alpha-2 238 5/31/2023
2023.0.7 171 5/12/2023
2023.0.6 300 5/10/2023
2023.0.5 170 5/7/2023
2023.0.4 194 4/22/2023
2023.0.3 227 4/19/2023
2023.0.2 213 4/6/2023
2023.0.1 223 3/13/2023
2022.9.0 324 10/15/2022