Register AuthenticateRequest handler¶
This operation runs once per module instance, when ASP.NET first initializes clsSecurityModule. Its sole purpose is to attach the module's request-authentication handler to the hosting application's AuthenticateRequest event, which is what makes every subsequent inbound request pass through this library's authentication logic before reaching the application.
| Field | Value |
|---|---|
| Operation ID | register-authenticate-request-handler |
| Trigger | ASP.NET calls IHttpModule.Init during module initialization. |
| Inputs | context As HttpApplication |
| Outputs | AuthRequest_Handler subscribed to context.AuthenticateRequest |
| Primary components | clsSecurityModule.Init |
| Entry point | SAIF.Framework.SecurityModule\clsSecurityModule.vb |
Steps¶
- Receive the hosting
HttpApplicationinstance from the ASP.NET runtime. - Register
AddressOf AuthRequest_Handlerwithcontext.AuthenticateRequest, so that every future request on this application enters the module's authentication workflow. - Return immediately without storing any additional module state.
- On failure: the method contains no local error handling, so any exception raised during registration propagates unchanged to the hosting runtime.
- Leave cleanup empty, since
Dispose()is implemented as a no-op and the module holds no resources that need releasing.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([ASP.NET initializes module]) --> S1[Receive HttpApplication]
S1 --> S2[Attach AuthRequest_Handler to AuthenticateRequest]
S2 --> EndOk([Module ready for request authentication])
Failure and edge-case behavior¶
Dispose()performs no unregistration or cleanup, so the module relies entirely on the hosting ASP.NET runtime for its lifetime management.- The method does not guard against duplicate registration; it assumes ASP.NET calls
Initexactly once per module instance, which is the standardIHttpModulecontract.
Related documentation¶
Sources¶
SAIF.Framework.SecurityModule\clsSecurityModule.vb