HCS.Passwordless.Otp
2.0.2
dotnet add package HCS.Passwordless.Otp --version 2.0.2
NuGet\Install-Package HCS.Passwordless.Otp -Version 2.0.2
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="HCS.Passwordless.Otp" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HCS.Passwordless.Otp" Version="2.0.2" />
<PackageReference Include="HCS.Passwordless.Otp" />
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 HCS.Passwordless.Otp --version 2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HCS.Passwordless.Otp, 2.0.2"
#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 HCS.Passwordless.Otp@2.0.2
#: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=HCS.Passwordless.Otp&version=2.0.2
#tool nuget:?package=HCS.Passwordless.Otp&version=2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HCS.Passwordless.Otp
OTP (One-Time Password) add-on for HCS.Passwordless. Delivers a short numeric code by email that the member enters to sign in.
Requirements
- Umbraco 17.3.5 or later (
[17.3.5, 18.0.0)) HCS.Passwordless.Coreis pulled in automatically as a transitive dependency
Installation
dotnet add package HCS.Passwordless.Otp
Setup
1. Register (Program.cs)
builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddPasswordlessOtp()
.Build();
2. Configure (appsettings.json)
{
"HCS": {
"Authentication": {
"Otp": {
"Enabled": true,
"TokenLifespan": "00:05:00",
"CodeLength": 6,
"MaxAttempts": 5,
"LockoutDuration": "00:15:00",
"NotificationSubject": "Your sign-in code",
"NotificationPartial": "Emails/Passwordless/Otp"
}
}
}
}
3. OTP form partial
@await Html.PartialAsync("Passwordless/OtpForm")
Configuration Options
HCS:Authentication:Otp
| Key | Type | Default | Description |
|---|---|---|---|
Enabled |
bool | true |
Enable/disable OTP flow |
TokenLifespan |
TimeSpan | 00:05:00 |
How long a code is valid |
CodeLength |
int | 6 |
Number of digits in the code |
MaxAttempts |
int | 5 |
Failed attempts before lockout |
LockoutDuration |
TimeSpan | 00:15:00 |
How long the lockout lasts |
NotificationSubject |
string | Your sign-in code |
Email subject line |
NotificationPartial |
string | Emails/Passwordless/Otp |
Razor partial path for the OTP email body |
Endpoints
| Method | Path | Description |
|---|---|---|
POST |
/auth/otp/request |
Request an OTP code email |
POST |
/auth/otp/verify |
Submit a code to sign in |
Email Templates
Override the default templates in your host project:
Views/
Emails/
Passwordless/
Otp.cshtml # HTML email
Otp.Text.cshtml # Plain-text email
Replacing Services
| Interface | Default | Purpose |
|---|---|---|
IOtpNotificationSender |
EmailOtpNotificationSender |
Send OTP emails |
IOtpCodeStore |
DistributedCacheOtpCodeStore |
Store OTP codes |
IAttemptCounter |
InMemoryAttemptCounter |
Track failed attempts |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- HCS.Passwordless.Core (>= 2.0.2)
- MailKit (>= 4.16.0)
- Umbraco.Cms.Core (>= 17.3.5 && < 18.0.0)
- Umbraco.Cms.Infrastructure (>= 17.3.5 && < 18.0.0)
- Umbraco.Cms.Web.Common (>= 17.3.5 && < 18.0.0)
- Umbraco.Cms.Web.Website (>= 17.3.5 && < 18.0.0)
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 |
|---|---|---|
| 2.0.2 | 91 | 5/18/2026 |
| 2.0.1 | 90 | 5/18/2026 |
| 2.0.0 | 88 | 5/18/2026 |
| 2.0.0-beta002 | 84 | 5/18/2026 |
| 2.0.0-beta001 | 81 | 5/18/2026 |
| 1.0.1 | 90 | 5/18/2026 |
| 1.0.0 | 92 | 5/18/2026 |
| 1.0.0-beta002 | 78 | 5/18/2026 |
| 1.0.0-beta001 | 81 | 5/18/2026 |