I read the .NET4 sources (they can be downloaded for free for research), and I found something strange in the implementation System.Web.Security.FormsAuthenticationModule.
The class is declared as follows:
public sealed class FormsAuthenticationModule : IHttpModule
where it IHttpModulehas two methods: Init()and Dispose().
Inside OnEnter()there are the following lines:
// Step 2: Call OnAuthenticate virtual method to create
// an IPrincipal for this request
OnAuthenticate( new FormsAuthenticationEventArgs(context) );
where is OnAuthenticate()declared as follows:
private void OnAuthenticate(FormsAuthenticationEventArgs e) {
Now the class sealed, so it is impossible to inherit. Also, OnAuthenticate()not virtual, so I don’t see how it could be redefined anyway.
So it looks like these comments are just out of date, and redefinition is OnAuthenticate()no longer possible.
Did something happen to me? Can this code allow overriding OnAuthenticate()?