C# Class Contrive.Auth.Web.Modules.AuthenticationModuleBase

Inheritance: IHttpModule
Show file Open project: alanstevens/Contrive

Protected Properties

Property Type Description
_realm string

Public Methods

Method Description
Dispose ( ) : void
Init ( System.Web.HttpApplication application ) : void

Inits the specified module.

Protected Methods

Method Description
AccessDenied ( System.Web.HttpApplication app ) : void
ApplicationAuthenticateRequest ( object sender, EventArgs e ) : void

Handles the AuthenticateRequest event of the application control.

The main work is done here. We parse incoming headers, get user name and password from them. Then we verify the user name and password against configured membership provider.

ApplicationEndRequest ( object sender, EventArgs e ) : void

Handles the EndRequest event of the application control.

This methods adds the "WWW-Authenticate" challenge header to all requests ending with the HTTP status code 401 (Access Denied), set either in this module's application_AuthenticateRequest or in any other place in application (most likely the authorization module).

Authenticate ( System.Web.HttpApplication app ) : bool
BuildChallengeHeader ( System.Web.HttpApplication app ) : string
GetConfigurationProvider ( ) : IConfigurationProvider
GetUserService ( ) : IUserService

Method Details

AccessDenied() protected static method

protected static AccessDenied ( System.Web.HttpApplication app ) : void
app System.Web.HttpApplication
return void

ApplicationAuthenticateRequest() protected method

Handles the AuthenticateRequest event of the application control.
The main work is done here. We parse incoming headers, get user name and password from them. Then we verify the user name and password against configured membership provider.
protected ApplicationAuthenticateRequest ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs /// The instance containing the event data. ///
return void

ApplicationEndRequest() protected method

Handles the EndRequest event of the application control.
This methods adds the "WWW-Authenticate" challenge header to all requests ending with the HTTP status code 401 (Access Denied), set either in this module's application_AuthenticateRequest or in any other place in application (most likely the authorization module).
protected ApplicationEndRequest ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs /// The instance containing the event data. ///
return void

Authenticate() protected abstract method

protected abstract Authenticate ( System.Web.HttpApplication app ) : bool
app System.Web.HttpApplication
return bool

BuildChallengeHeader() protected abstract method

protected abstract BuildChallengeHeader ( System.Web.HttpApplication app ) : string
app System.Web.HttpApplication
return string

Dispose() public method

public Dispose ( ) : void
return void

GetConfigurationProvider() protected static method

protected static GetConfigurationProvider ( ) : IConfigurationProvider
return IConfigurationProvider

GetUserService() protected static method

protected static GetUserService ( ) : IUserService
return IUserService

Init() public method

Inits the specified module.
public Init ( System.Web.HttpApplication application ) : void
application System.Web.HttpApplication The HTTP application containing the module.
return void

Property Details

_realm protected property

protected string _realm
return string