https://github.com/kode-rex/hangfirebasicauthenticationfilter
A basic auth filter for hangfire dashboard
https://github.com/kode-rex/hangfirebasicauthenticationfilter
hangfire
Last synced: 6 months ago
JSON representation
A basic auth filter for hangfire dashboard
- Host: GitHub
- URL: https://github.com/kode-rex/hangfirebasicauthenticationfilter
- Owner: Kode-Rex
- License: gpl-3.0
- Created: 2019-01-10T15:34:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T22:01:22.000Z (over 2 years ago)
- Last Synced: 2025-04-18T04:03:23.275Z (6 months ago)
- Topics: hangfire
- Language: C#
- Homepage:
- Size: 28.3 KB
- Stars: 28
- Watchers: 2
- Forks: 13
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NuGet
The dotnet core nuget package can be found at https://www.nuget.org/packages/Hangfire.Dashboard.Basic.Authentication
## About ##
Hangfire.Dashboard.Basic.Authentication is a re-usable Hangfire Basic Authentication filter that can be easily imported and configured in your project. It provides a quick and easy way to add basic authentication to your Hangfire dashboard, without the need for complex configuration.
## Configurion ##
In your startup file, configure the Hangfire dashboard options and add the BasicAuthAuthorizationFilter:
```C#
using Hangfire.Dashboard.Basic.Authentication;// ...
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// ...var options = new DashboardOptions
{
Authorization = new[]
{
new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
{
SslRedirect = false,
RequireSsl = false,
LoginCaseSensitive = true,
Users = new []
{
new BasicAuthAuthorizationUser
{
Login = "myuser",
PasswordClear = "mypassword"
}
}
})
}
};app.UseHangfireDashboard("/hangfire", options);
app.UseHangfireServer();// ...
}
```## Usage ##
Just replace my_username and my_password with your desired values. And tune the SSL setting for your needs.