When is WindowsAuthenticationEventArgs.Identity.IsAnonymous ever true?

beau

New Member
I see this check for 'IsAnonymous' in global.asax many asp.net web authentication samples.\[code\]public void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs args){ if(!args.Identity.IsAnonymous) args.User = new Samples.AspNet.Security.MyPrincipal(args.Identity);}\[/code\]However, my understanding is that the \[code\]WindowsAuthenticationModule\[/code\] is invoked only when the asp.net website \[code\]authenticationMode\[/code\] is configured as 'Windows', meaning the user must be authenticated or is denied access.In what scenario, therefore, would \[code\]IsAnonymous\[/code\] be true if this event is raised?I could not create an authentication scenario in IIS 7.5 where this event is raised but this user is anonymous.(This a practical question, not just theoretical, as we have two sites: internal with WindowsAuthentication enabled and public with Anonymous enabled, and if I am missing an opportunity where custom authorization can leverage this event for both sites, I would like to understand it better.)
 
Back
Top