Soenneker.Hangfire.BasicAuthentication 4.0.2119

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Hangfire.BasicAuthentication --version 4.0.2119
                    
NuGet\Install-Package Soenneker.Hangfire.BasicAuthentication -Version 4.0.2119
                    
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="Soenneker.Hangfire.BasicAuthentication" Version="4.0.2119" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Hangfire.BasicAuthentication" Version="4.0.2119" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Hangfire.BasicAuthentication" />
                    
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 Soenneker.Hangfire.BasicAuthentication --version 4.0.2119
                    
#r "nuget: Soenneker.Hangfire.BasicAuthentication, 4.0.2119"
                    
#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 Soenneker.Hangfire.BasicAuthentication@4.0.2119
                    
#: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=Soenneker.Hangfire.BasicAuthentication&version=4.0.2119
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Hangfire.BasicAuthentication&version=4.0.2119
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Hangfire.BasicAuthentication

Protects a Hangfire dashboard with HTTP Basic authentication. The configured password is a PBKDF2 PHC record, so plaintext dashboard credentials do not need to be stored in application configuration.

Installation

dotnet add package Soenneker.Hangfire.BasicAuthentication

Configuration

{
  "Hangfire": {
    "Username": "admin",
    "PasswordPhc": "<PBKDF2 PHC record>",
    "LocalAuthenticationBypassEnabled": false,
    "Url": "/hangfire"
  }
}

Generate the PHC value once and store it in a secret provider:

using Soenneker.Hashing.Pbkdf2;

string passwordPhc = Pbkdf2HashingUtil.Hash("replace-with-a-strong-password");

Registration and middleware order

using Hangfire;
using Soenneker.Hangfire.BasicAuthentication;
using Soenneker.Hangfire.BasicAuthentication.Registrars;

builder.Services.AddHangfireBasicAuth();

app.UseHangfireAuthorized();

app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
    Authorization = [new HangfireAuthorizationFilter()]
});

UseHangfireAuthorized() must appear before UseHangfireDashboard(), and Hangfire:Url must match the dashboard path. HangfireAuthorizationFilter deliberately allows Hangfire's internal authorization stage to continue because the preceding middleware performs the credential check; do not use that filter without the middleware.

Requests outside the configured dashboard path are unaffected. Matching requests without valid credentials receive 401 Unauthorized and a WWW-Authenticate: Basic challenge.

Enable LocalAuthenticationBypassEnabled only when every request considered local by the application is trusted. Basic authentication must be served over HTTPS because credentials are encoded, not encrypted, in the request header.

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
4.0.2140 34 9/8/2026
4.0.2139 28 9/8/2026
4.0.2138 38 9/8/2026
4.0.2137 40 9/8/2026
4.0.2135 52 9/7/2026
4.0.2134 45 9/7/2026
4.0.2133 47 9/7/2026
4.0.2132 55 9/5/2026
4.0.2131 51 9/5/2026
4.0.2130 54 9/4/2026
4.0.2128 53 9/4/2026
4.0.2127 52 9/4/2026
4.0.2126 52 9/4/2026
4.0.2125 51 9/4/2026
4.0.2124 81 9/1/2026
4.0.2123 82 8/31/2026
4.0.2122 84 8/31/2026
4.0.2121 89 8/31/2026
4.0.2120 83 8/31/2026
4.0.2119 82 8/31/2026
Loading failed

Update dependency Soenneker.Validators.BasicAuth to 4.0.210 (#2909)