////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/// <include file='doc\FormsAuthenticationModule.uex' path='docs/doc[@for="FormsAuthenticationModule.OnEnter"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
private void OnEnter(Object source, EventArgs eventArgs)
{
if (_fAuthChecked && !_fAuthRequired)
{
return;
}
HttpApplication app;
HttpContext context;
app = (HttpApplication)source;
context = app.Context;
AuthenticationConfig settings = (AuthenticationConfig)context.GetConfig("system.web/authentication");
if (!_fAuthChecked)
{
_fAuthRequired = (settings.Mode == AuthenticationMode.Forms);
_fAuthChecked = true;
}
if (!_fAuthRequired)
{
return;
}
if (!_fFormsInit)
{
Trace("Initializing Forms Auth Manager");
FormsAuthentication.Initialize();
_FormsName = settings.CookieName;
if (_FormsName == null)
{
_FormsName = CONFIG_DEFAULT_COOKIE;
}
Trace("Forms name is: " + _FormsName);
_LoginUrl = settings.LoginUrl;
if (_LoginUrl == null)
{
_LoginUrl = CONFIG_DEFAULT_LOGINURL;
}
_fFormsInit = true;
}
////////////////////////////////////////////////////////
// Step 2: Call OnAuthenticate virtual method to create
// an IPrincipal for this request
OnAuthenticate(new FormsAuthenticationEventArgs(context));
////////////////////////////////////////////////////////
// Skip AuthZ if accessing the login page
context.SkipAuthorization = AuthenticationConfig.AccessingLoginPage(context, _LoginUrl);
}