Class BasicAuthenticationHttpModule
Implements an System.Web.IHttpModule ensuring that all requests to particular addresses have Basic Authentication HTTP header and issuing 401 challenges if the header is missing.
Inheritance
Implements
Inherited Members
Namespace: Nevatech.Vsb.Repository.Security
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class BasicAuthenticationHttpModule : IHttpModule
Constructors
BasicAuthenticationHttpModule()
Declaration
public BasicAuthenticationHttpModule()
Properties
IsEnabled
Gets flag indicating that module is installed and enabled in the current application.
Declaration
public static bool IsEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddAddress(Uri, String, Boolean)
Adds provided URL to the list of addresses the require Basic Authentication HTTP header.
Declaration
public static void AddAddress(Uri address, string realm, bool isSoap)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | address | A URL to be registered. |
System.String | realm | Authentication realm to be sent in HTTP header. |
System.Boolean | isSoap | Flag indicating that provided URL belongs to a SOAP endpoint. If False then URL belongs to a REST endpoint. |
Remarks
SOAP addresses are matched exactly and applied to "POST" requests only. REST addresses are matched as "starts with" and applied to all requests.
Dispose()
Disposes of the resources (other than memory) used by the module.
Declaration
public void Dispose()
Init(HttpApplication)
Initializes a module and prepares it to handle requests.
Declaration
public void Init(HttpApplication context)
Parameters
Type | Name | Description |
---|---|---|
System.Web.HttpApplication | context | An System.Web.HttpApplication that provides access to the methods, properties, and events common to all application objects within an ASP.NET application. |
RemoveAddress(Uri)
Removes provided URL from the list of addresses the require Basic Authentication HTTP header.
Declaration
public static void RemoveAddress(Uri address)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | address | A URL to be unregistered. |