DotNetBrightener.TimeBasedOtp 2024.0.14.6-preview-242730701

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.6-preview-242730701                
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.14.6-preview-242730701                
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.6-preview-242730701" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetBrightener.TimeBasedOtp --version 2024.0.14.6-preview-242730701                
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.14.6-preview-242730701"                
#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.
// Install DotNetBrightener.TimeBasedOtp as a Cake Addin
#addin nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.14.6-preview-242730701&prerelease

// Install DotNetBrightener.TimeBasedOtp as a Cake Tool
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.14.6-preview-242730701&prerelease                

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. 
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.3 87 2/10/2025
2025.0.3-preview-288 82 2/10/2025
2025.0.2 89 1/21/2025
2025.0.2-preview-278 68 1/21/2025
2025.0.2-preview-277 75 12/16/2024
2025.0.1-rc-243301701 247 11/25/2024
2024.0.14.6 97 11/25/2024
2024.0.14.6-rc-243031001 137 10/29/2024
2024.0.14.6-rc-243030701 88 10/29/2024
2024.0.14.6-rc-242840501 83 10/10/2024
2024.0.14.6-rc-242820305 81 10/8/2024
2024.0.14.6-rc-242771401 147 10/3/2024
2024.0.14.6-rc-242770501 77 10/3/2024
2024.0.14.6-rc-242770201 90 10/3/2024
2024.0.14.6-rc-242761801 83 10/2/2024
2024.0.14.6-rc-242761601 85 10/2/2024
2024.0.14.6-rc-242761501 84 10/2/2024
2024.0.14.6-rc-242761401 92 10/2/2024
2024.0.14.6-rc-242760701 93 10/2/2024
2024.0.14.6-rc-242751002 86 10/1/2024
2024.0.14.6-rc-242750901 91 10/1/2024
2024.0.14.6-rc-242750502 80 10/1/2024
2024.0.14.6-rc-242750201 86 10/1/2024
2024.0.14.6-rc-242741501 77 9/30/2024
2024.0.14.6-rc-242730701 99 9/29/2024
2024.0.14.6-preview-2730501 90 9/29/2024
2024.0.14.6-preview-2701501 92 9/26/2024
2024.0.14.6-preview-2620901 129 9/18/2024
2024.0.14.6-preview-2570701 96 9/13/2024
2024.0.14.6-preview-2510703 119 9/7/2024
2024.0.14.6-preview-2480501 115 9/4/2024
2024.0.14.6-preview-2430401 119 8/30/2024
2024.0.14.6-preview-242730701 83 9/29/2024
2024.0.14.6-preview-2421703 92 8/29/2024
2024.0.14.6-preview-2421701 76 8/29/2024
2024.0.14.6-preview-2420901 91 8/29/2024
2024.0.14.6-preview-2390101 108 8/26/2024
2024.0.14.6-preview-2381603 111 8/25/2024
2024.0.14.6-preview-2341601 122 8/21/2024
2024.0.14.6-preview-2321602 98 8/20/2024
2024.0.14.6-preview-2190801 140 8/6/2024
2024.0.14.6-preview-2041501 105 7/22/2024
2024.0.14.6-preview-1920603 166 7/10/2024
2024.0.14.6-preview-1920301 81 7/10/2024
2024.0.14.6-preview-1911302 111 7/9/2024
2024.0.14.6-preview-1901001 124 7/8/2024
2024.0.14.6-preview-1900901 102 7/8/2024
2024.0.14.6-preview-1900801 97 7/8/2024
2024.0.14.6-preview-1860304 105 7/4/2024
2024.0.14.5 168 7/1/2024
2024.0.14.5-preview-1811601 101 6/29/2024
2024.0.14.5-preview-1810501 121 6/29/2024
2024.0.14.5-preview-180132 113 6/28/2024
2024.0.14.5-preview-180131 106 6/28/2024
2024.0.14.5-preview-180121 99 6/28/2024
2024.0.14.4 127 6/27/2024
2024.0.14.4-preview-7 99 6/27/2024
2024.0.14.3 99 6/21/2024
2024.0.14.1 109 6/6/2024
2024.0.14.1-preview 94 6/6/2024
2024.0.14-preview-1 100 6/6/2024
2024.0.13.8-preview 99 6/6/2024
2024.0.13.1-preview-0146 94 6/6/2024
2024.0.12.15803-preview-03 81 6/6/2024
2024.0.12.15608 120 6/4/2024
2024.0.12.15515 199 6/3/2024
2024.0.12.15220 113 5/31/2024
2024.0.12.15220-alpha31-240... 87 5/31/2024
2024.0.12.14911 152 5/28/2024
2024.0.12.14910-alpha28-240... 97 5/28/2024
2024.0.12.14823 123 5/27/2024
2024.0.12.14522-alpha7-2405... 106 5/24/2024
2024.0.12.14514-alpha6-2405... 108 5/24/2024
2024.0.12.14511 134 5/24/2024
2024.0.12.14314 140 5/22/2024
2024.0.12.14114 111 5/20/2024
2024.0.12.12815 159 5/7/2024
2024.0.12.12814 133 5/7/2024
2024.0.12.12721 127 5/6/2024
2024.0.12.12702 116 5/5/2024
2024.0.12.12622 150 5/5/2024
2024.0.12.12514 120 5/4/2024
2024.0.12.12512 111 5/4/2024
2024.0.12.12510 134 5/4/2024
2024.0.12.12420 113 5/3/2024
2024.0.12.12319 65 5/2/2024
2024.0.12.12319-rc-2405021801 63 5/2/2024
2024.0.12.12318 80 5/2/2024
2024.0.12.12215 112 5/1/2024
2024.0.12.12011 113 4/29/2024
2024.0.12.11720 135 4/26/2024
2024.0.12.11719 120 4/26/2024
2024.0.12.11621 139 4/25/2024
2024.0.12.11523 121 4/24/2024
2024.0.12.11522 121 4/24/2024
2024.0.12.11417 143 4/23/2024
2024.0.12.11400 158 4/22/2024
2024.0.12.11316 126 4/22/2024
2024.0.11.10220 118 4/11/2024
2024.0.11.10120 111 4/10/2024
2024.0.11.10119 94 4/10/2024
2024.0.11.10115 113 4/10/2024
2024.0.11.9914 153 4/8/2024
2024.0.11.9901 124 4/7/2024
2024.0.11.9823 135 4/7/2024
2024.0.11.9401 127 4/2/2024
2024.0.11.9301 109 4/1/2024
2024.0.11.9206 119 3/31/2024
2024.0.11.9205 116 3/31/2024
2024.0.11.8200 139 3/21/2024
2024.0.11.8122 106 3/21/2024
2024.0.11.8120 114 3/21/2024
2024.0.11.7320 185 3/13/2024
2024.0.11.7316 136 3/13/2024
2024.0.11.7310 128 3/13/2024
2024.0.11 133 3/13/2024
2024.0.10 162 3/3/2024
2024.0.9 115 2/27/2024
2024.0.8 177 2/1/2024
2024.0.7 137 1/26/2024
2024.0.6 123 1/25/2024
2024.0.5 117 1/24/2024
2024.0.4 118 1/24/2024
2024.0.3 116 1/22/2024
2024.0.2 185 1/10/2024
2024.0.1 125 1/9/2024
2024.0.1-alpha-3 104 1/9/2024
2024.0.1-alpha-2 98 1/9/2024
2024.0.1-alpha-1 136 1/3/2024
2024.0.0 187 12/26/2023
2023.0.27 146 12/21/2023
2023.0.26 118 12/21/2023
2023.0.25 149 12/11/2023
2023.0.24 134 12/8/2023
2023.0.23 135 12/6/2023
2023.0.21 136 12/4/2023
2023.0.20 173 11/27/2023
2023.0.19 129 11/20/2023
2023.0.18 166 10/25/2023
2023.0.17 196 10/22/2023
2023.0.16 171 10/16/2023
2023.0.16-alpha-1 90 10/16/2023
2023.0.15 154 10/14/2023
2023.0.14 122 10/14/2023
2023.0.13 139 10/14/2023
2023.0.12 133 10/14/2023
2023.0.11 124 10/10/2023
2023.0.10 137 10/9/2023
2023.0.9 160 8/16/2023
2023.0.8 156 8/15/2023
2023.0.8-alpha-2 220 5/31/2023
2023.0.7 153 5/12/2023
2023.0.6 208 5/10/2023
2023.0.5 149 5/7/2023
2023.0.4 174 4/22/2023
2023.0.3 207 4/19/2023
2023.0.2 192 4/6/2023
2023.0.1 204 3/13/2023
2022.9.0 303 10/15/2022