DotNetBrightener.TimeBasedOtp 2024.0.11.7316

There is a newer version of this package available.
See the version list below for details.
dotnet add package DotNetBrightener.TimeBasedOtp --version 2024.0.11.7316                
NuGet\Install-Package DotNetBrightener.TimeBasedOtp -Version 2024.0.11.7316                
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.11.7316" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetBrightener.TimeBasedOtp --version 2024.0.11.7316                
#r "nuget: DotNetBrightener.TimeBasedOtp, 2024.0.11.7316"                
#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.11.7316

// Install DotNetBrightener.TimeBasedOtp as a Cake Tool
#tool nuget:?package=DotNetBrightener.TimeBasedOtp&version=2024.0.11.7316                

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-preview-277 70 a month ago
2025.0.1-rc-243301701 191 2 months ago
2024.0.14.6 94 2 months ago
2024.0.14.6-rc-243031001 134 3 months ago
2024.0.14.6-rc-243030701 84 3 months ago
2024.0.14.6-rc-242840501 80 3 months ago
2024.0.14.6-rc-242820305 78 3 months ago
2024.0.14.6-rc-242771401 144 4 months ago
2024.0.14.6-rc-242770501 74 4 months ago
2024.0.14.6-rc-242770201 87 4 months ago
2024.0.14.6-rc-242761801 76 4 months ago
2024.0.14.6-rc-242761601 79 4 months ago
2024.0.14.6-rc-242761501 79 4 months ago
2024.0.14.6-rc-242761401 88 4 months ago
2024.0.14.6-rc-242760701 87 4 months ago
2024.0.14.6-rc-242751002 82 4 months ago
2024.0.14.6-rc-242750901 85 4 months ago
2024.0.14.6-rc-242750502 74 4 months ago
2024.0.14.6-rc-242750201 82 4 months ago
2024.0.14.6-rc-242741501 73 4 months ago
2024.0.14.6-rc-242730701 95 4 months ago
2024.0.14.6-preview-2730501 86 4 months ago
2024.0.14.6-preview-2701501 88 4 months ago
2024.0.14.6-preview-2620901 125 4 months ago
2024.0.14.6-preview-2570701 94 4 months ago
2024.0.14.6-preview-2510703 117 4 months ago
2024.0.14.6-preview-2480501 111 5 months ago
2024.0.14.6-preview-2430401 115 5 months ago
2024.0.14.6-preview-242730701 79 4 months ago
2024.0.14.6-preview-2421703 90 5 months ago
2024.0.14.6-preview-2421701 74 5 months ago
2024.0.14.6-preview-2420901 89 5 months ago
2024.0.14.6-preview-2390101 104 5 months ago
2024.0.14.6-preview-2381603 105 5 months ago
2024.0.14.6-preview-2341601 119 5 months ago
2024.0.14.6-preview-2321602 96 5 months ago
2024.0.14.6-preview-2190801 137 5 months ago
2024.0.14.6-preview-2041501 103 6 months ago
2024.0.14.6-preview-1920603 162 6 months ago
2024.0.14.6-preview-1920301 76 6 months ago
2024.0.14.6-preview-1911302 109 6 months ago
2024.0.14.6-preview-1901001 121 6 months ago
2024.0.14.6-preview-1900901 100 6 months ago
2024.0.14.6-preview-1900801 95 6 months ago
2024.0.14.6-preview-1860304 103 7 months ago
2024.0.14.5 166 7 months ago
2024.0.14.5-preview-1811601 98 7 months ago
2024.0.14.5-preview-1810501 116 7 months ago
2024.0.14.5-preview-180132 111 7 months ago
2024.0.14.5-preview-180131 103 7 months ago
2024.0.14.5-preview-180121 95 7 months ago
2024.0.14.4 125 7 months ago
2024.0.14.4-preview-7 97 7 months ago
2024.0.14.3 97 7 months ago
2024.0.14.1 107 7 months ago
2024.0.14.1-preview 92 7 months ago
2024.0.14-preview-1 98 7 months ago
2024.0.13.8-preview 97 7 months ago
2024.0.13.1-preview-0146 92 7 months ago
2024.0.12.15803-preview-03 79 7 months ago
2024.0.12.15608 118 8 months ago
2024.0.12.15515 197 8 months ago
2024.0.12.15220 111 8 months ago
2024.0.12.15220-alpha31-240... 84 8 months ago
2024.0.12.14911 150 8 months ago
2024.0.12.14910-alpha28-240... 91 8 months ago
2024.0.12.14823 121 8 months ago
2024.0.12.14522-alpha7-2405... 104 8 months ago
2024.0.12.14514-alpha6-2405... 106 8 months ago
2024.0.12.14511 132 8 months ago
2024.0.12.14314 136 8 months ago
2024.0.12.14114 109 8 months ago
2024.0.12.12815 157 8 months ago
2024.0.12.12814 128 8 months ago
2024.0.12.12721 125 8 months ago
2024.0.12.12702 114 9 months ago
2024.0.12.12622 148 9 months ago
2024.0.12.12514 116 9 months ago
2024.0.12.12512 107 9 months ago
2024.0.12.12510 130 9 months ago
2024.0.12.12420 111 9 months ago
2024.0.12.12319 63 9 months ago
2024.0.12.12319-rc-2405021801 60 9 months ago
2024.0.12.12318 78 9 months ago
2024.0.12.12215 110 9 months ago
2024.0.12.12011 111 9 months ago
2024.0.12.11720 133 9 months ago
2024.0.12.11719 118 9 months ago
2024.0.12.11621 137 9 months ago
2024.0.12.11523 119 9 months ago
2024.0.12.11522 119 9 months ago
2024.0.12.11417 141 9 months ago
2024.0.12.11400 151 9 months ago
2024.0.12.11316 124 9 months ago
2024.0.11.10220 116 9 months ago
2024.0.11.10120 109 9 months ago
2024.0.11.10119 92 9 months ago
2024.0.11.10115 112 9 months ago
2024.0.11.9914 147 9 months ago
2024.0.11.9901 123 9 months ago
2024.0.11.9823 134 9 months ago
2024.0.11.9401 126 10 months ago
2024.0.11.9301 108 10 months ago
2024.0.11.9206 118 10 months ago
2024.0.11.9205 115 10 months ago
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 170 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