Skip to main content
net7.0

The official Bitwarden Passwordless.dev .NET library for ASP.NET Core identity

Published
May 21, 2024
2y ago
Total Downloads
49.1K
49,078

Install

dotnet add package Passwordless.AspNetCore --version 0.0.0-ci-d5f30b6
ProductVersions
.NET
net7.0

README

Passwordless ASP.NET Core Integration

Version Downloads

The official Bitwarden Passwordless.dev ASP.NET Identity integration. Automatically adds endpoints to verify passwordless signin and sign the user in using the existing ASP.NET Identity code.

Install

  • NuGet: dotnet add package Passwordless.AspNetCore

Usage

đź’ˇ See the full Getting started guide in the official documentation.

Using Minimal APIs

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddIdentity<MyUser, MyRole>()
      .AddEntityFrameworkStores<MyDbContext>()
      .AddPasswordless(builder.Configuration.GetRequiredSection("Passwordless"));

var app = builder.Build();

app.MapPasswordless();

app.Run();

Using Startup class

// In Startup.cs
public void ConfigureServices(IServiceCollection services)
{
    services.AddIdentity<MyUser, MyRole>()
      .AddEntityFrameworkStores<MyDbContext>()
      .AddPasswordless(Configuration.GetRequiredSection("Passwordless"));

    services.AddControllers();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseRouting();

    app.UseAuthentication();
    app.UseAuthorization();

    app.UseEndpoints(endpoints =>
    {
        endpoints.MapPasswordless();
        endpoints.MapControllers();
    });
}

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.