HCS.Passwordless.Otp 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package HCS.Passwordless.Otp --version 2.0.0
                    
NuGet\Install-Package HCS.Passwordless.Otp -Version 2.0.0
                    
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.0" />
                    
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.0" />
                    
Directory.Packages.props
<PackageReference Include="HCS.Passwordless.Otp" />
                    
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 HCS.Passwordless.Otp --version 2.0.0
                    
#r "nuget: HCS.Passwordless.Otp, 2.0.0"
                    
#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.0
                    
#: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.0
                    
Install as a Cake Addin
#tool nuget:?package=HCS.Passwordless.Otp&version=2.0.0
                    
Install as a Cake Tool

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 13 ([13.0, 14.0))
  • HCS.Passwordless.Core is 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. Map endpoints (Program.cs)

app.MapPasswordlessMembers()
    .WithOtp();

3. 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"
      }
    }
  }
}

4. 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 Email subject line

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 DistributedCacheAttemptCounter Track failed attempts
Product 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.

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