Class BasicAuthenticationMiddleware
Provides basic authentication via back-office credentials for public website access if configured for use and the client IP is not allow listed.
Inheritance
Namespace: Umbraco.Cms.Web.Common.Middleware
Assembly: Umbraco.Web.Website.dll
Syntax
public class BasicAuthenticationMiddleware
Constructors
View SourceBasicAuthenticationMiddleware(IRuntimeState, IBasicAuthService, IHostingEnvironment)
Initializes a new instance of the BasicAuthenticationMiddleware class.
Declaration
[Obsolete("Please use the constructor with all parameters. Scheduled for removal in Umbraco 19.")]
public BasicAuthenticationMiddleware(IRuntimeState runtimeState, IBasicAuthService basicAuthService, IHostingEnvironment hostingEnvironment)
Parameters
| Type | Name | Description |
|---|---|---|
| IRuntimeState | runtimeState | The runtime state used to determine if the application is running. |
| IBasicAuthService | basicAuthService | The service providing basic authentication configuration and validation. |
| IHostingEnvironment | hostingEnvironment | The hosting environment used to resolve the backoffice path. |
BasicAuthenticationMiddleware(IRuntimeState, IBasicAuthService, IHostingEnvironment, IPreviewService)
Initializes a new instance of the BasicAuthenticationMiddleware class.
Declaration
public BasicAuthenticationMiddleware(IRuntimeState runtimeState, IBasicAuthService basicAuthService, IHostingEnvironment hostingEnvironment, IPreviewService previewService)
Parameters
| Type | Name | Description |
|---|---|---|
| IRuntimeState | runtimeState | The runtime state used to determine if the application is running. |
| IBasicAuthService | basicAuthService | The service providing basic authentication configuration and validation. |
| IHostingEnvironment | hostingEnvironment | The hosting environment used to resolve the backoffice path. |
| IPreviewService | previewService | The service used to resolve the back-office user previewing the front-end. |
Methods
View SourceInvokeAsync(HttpContext, RequestDelegate)
Declaration
public Task InvokeAsync(HttpContext context, RequestDelegate next)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | |
| RequestDelegate | next |
Returns
| Type | Description |
|---|---|
| Task |