DotNetBrightener.TimeBasedOtp 2024.0.14.6-preview-2480501

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-2480501                
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.14.6-preview-2480501                
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-2480501" />                
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-2480501                
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.14.6-preview-2480501"                
#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-2480501&prerelease

// Install DotNetBrightener.TimeBasedOtp as a Cake Tool
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.14.6-preview-2480501&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.2 69 1/21/2025
2025.0.2-preview-278 55 1/21/2025
2025.0.2-preview-277 72 12/16/2024
2025.0.1-rc-243301701 210 11/25/2024
2024.0.14.6 96 11/25/2024
2024.0.14.6-rc-243031001 136 10/29/2024
2024.0.14.6-rc-243030701 87 10/29/2024
2024.0.14.6-rc-242840501 82 10/10/2024
2024.0.14.6-rc-242820305 80 10/8/2024
2024.0.14.6-rc-242771401 146 10/3/2024
2024.0.14.6-rc-242770501 76 10/3/2024
2024.0.14.6-rc-242770201 89 10/3/2024
2024.0.14.6-rc-242761801 80 10/2/2024
2024.0.14.6-rc-242761601 83 10/2/2024
2024.0.14.6-rc-242761501 81 10/2/2024
2024.0.14.6-rc-242761401 90 10/2/2024
2024.0.14.6-rc-242760701 89 10/2/2024
2024.0.14.6-rc-242751002 84 10/1/2024
2024.0.14.6-rc-242750901 89 10/1/2024
2024.0.14.6-rc-242750502 78 10/1/2024
2024.0.14.6-rc-242750201 84 10/1/2024
2024.0.14.6-rc-242741501 75 9/30/2024
2024.0.14.6-rc-242730701 97 9/29/2024
2024.0.14.6-preview-2730501 88 9/29/2024
2024.0.14.6-preview-2701501 90 9/26/2024
2024.0.14.6-preview-2620901 127 9/18/2024
2024.0.14.6-preview-2570701 94 9/13/2024
2024.0.14.6-preview-2510703 117 9/7/2024
2024.0.14.6-preview-2480501 111 9/4/2024
2024.0.14.6-preview-2430401 117 8/30/2024
2024.0.14.6-preview-242730701 81 9/29/2024
2024.0.14.6-preview-2421703 90 8/29/2024
2024.0.14.6-preview-2421701 74 8/29/2024
2024.0.14.6-preview-2420901 89 8/29/2024
2024.0.14.6-preview-2390101 106 8/26/2024
2024.0.14.6-preview-2381603 105 8/25/2024
2024.0.14.6-preview-2341601 119 8/21/2024
2024.0.14.6-preview-2321602 96 8/20/2024
2024.0.14.6-preview-2190801 137 8/6/2024
2024.0.14.6-preview-2041501 103 7/22/2024
2024.0.14.6-preview-1920603 164 7/10/2024
2024.0.14.6-preview-1920301 79 7/10/2024
2024.0.14.6-preview-1911302 109 7/9/2024
2024.0.14.6-preview-1901001 121 7/8/2024
2024.0.14.6-preview-1900901 100 7/8/2024
2024.0.14.6-preview-1900801 95 7/8/2024
2024.0.14.6-preview-1860304 103 7/4/2024
2024.0.14.5 166 7/1/2024
2024.0.14.5-preview-1811601 98 6/29/2024
2024.0.14.5-preview-1810501 118 6/29/2024
2024.0.14.5-preview-180132 111 6/28/2024
2024.0.14.5-preview-180131 103 6/28/2024
2024.0.14.5-preview-180121 95 6/28/2024
2024.0.14.4 125 6/27/2024
2024.0.14.4-preview-7 97 6/27/2024
2024.0.14.3 97 6/21/2024
2024.0.14.1 107 6/6/2024
2024.0.14.1-preview 92 6/6/2024
2024.0.14-preview-1 98 6/6/2024
2024.0.13.8-preview 97 6/6/2024
2024.0.13.1-preview-0146 92 6/6/2024
2024.0.12.15803-preview-03 79 6/6/2024
2024.0.12.15608 118 6/4/2024
2024.0.12.15515 197 6/3/2024
2024.0.12.15220 111 5/31/2024
2024.0.12.15220-alpha31-240... 84 5/31/2024
2024.0.12.14911 150 5/28/2024
2024.0.12.14910-alpha28-240... 91 5/28/2024
2024.0.12.14823 121 5/27/2024
2024.0.12.14522-alpha7-2405... 104 5/24/2024
2024.0.12.14514-alpha6-2405... 106 5/24/2024
2024.0.12.14511 132 5/24/2024
2024.0.12.14314 138 5/22/2024
2024.0.12.14114 109 5/20/2024
2024.0.12.12815 157 5/7/2024
2024.0.12.12814 130 5/7/2024
2024.0.12.12721 125 5/6/2024
2024.0.12.12702 114 5/5/2024
2024.0.12.12622 148 5/5/2024
2024.0.12.12514 116 5/4/2024
2024.0.12.12512 107 5/4/2024
2024.0.12.12510 130 5/4/2024
2024.0.12.12420 111 5/3/2024
2024.0.12.12319 63 5/2/2024
2024.0.12.12319-rc-2405021801 60 5/2/2024
2024.0.12.12318 78 5/2/2024
2024.0.12.12215 110 5/1/2024
2024.0.12.12011 111 4/29/2024
2024.0.12.11720 133 4/26/2024
2024.0.12.11719 118 4/26/2024
2024.0.12.11621 137 4/25/2024
2024.0.12.11523 119 4/24/2024
2024.0.12.11522 119 4/24/2024
2024.0.12.11417 141 4/23/2024
2024.0.12.11400 154 4/22/2024
2024.0.12.11316 124 4/22/2024
2024.0.11.10220 116 4/11/2024
2024.0.11.10120 109 4/10/2024
2024.0.11.10119 92 4/10/2024
2024.0.11.10115 112 4/10/2024
2024.0.11.9914 147 4/8/2024
2024.0.11.9901 123 4/7/2024
2024.0.11.9823 134 4/7/2024
2024.0.11.9401 126 4/2/2024
2024.0.11.9301 108 4/1/2024
2024.0.11.9206 118 3/31/2024
2024.0.11.9205 115 3/31/2024
2024.0.11.8200 138 3/21/2024
2024.0.11.8122 105 3/21/2024
2024.0.11.8120 112 3/21/2024
2024.0.11.7320 184 3/13/2024
2024.0.11.7316 135 3/13/2024
2024.0.11.7310 127 3/13/2024
2024.0.11 132 3/13/2024
2024.0.10 161 3/3/2024
2024.0.9 114 2/27/2024
2024.0.8 176 2/1/2024
2024.0.7 136 1/26/2024
2024.0.6 122 1/25/2024
2024.0.5 116 1/24/2024
2024.0.4 117 1/24/2024
2024.0.3 115 1/22/2024
2024.0.2 184 1/10/2024
2024.0.1 124 1/9/2024
2024.0.1-alpha-3 102 1/9/2024
2024.0.1-alpha-2 97 1/9/2024
2024.0.1-alpha-1 135 1/3/2024
2024.0.0 186 12/26/2023
2023.0.27 145 12/21/2023
2023.0.26 117 12/21/2023
2023.0.25 148 12/11/2023
2023.0.24 133 12/8/2023
2023.0.23 134 12/6/2023
2023.0.21 135 12/4/2023
2023.0.20 172 11/27/2023
2023.0.19 128 11/20/2023
2023.0.18 165 10/25/2023
2023.0.17 195 10/22/2023
2023.0.16 170 10/16/2023
2023.0.16-alpha-1 89 10/16/2023
2023.0.15 153 10/14/2023
2023.0.14 120 10/14/2023
2023.0.13 138 10/14/2023
2023.0.12 132 10/14/2023
2023.0.11 123 10/10/2023
2023.0.10 136 10/9/2023
2023.0.9 159 8/16/2023
2023.0.8 155 8/15/2023
2023.0.8-alpha-2 216 5/31/2023
2023.0.7 148 5/12/2023
2023.0.6 172 5/10/2023
2023.0.5 144 5/7/2023
2023.0.4 169 4/22/2023
2023.0.3 202 4/19/2023
2023.0.2 187 4/6/2023
2023.0.1 197 3/13/2023
2022.9.0 297 10/15/2022