Hi WT,
As for the Requeste.IsAuthenticated or Request.AuthenticationType, they're
just the same like the
HttpContext.Current.User.Identity.AuthenticationType(IsAuthenticated ).
They actually represent the authentication type performed by the IIS web
server, such as "NTML" or "Negotiate" ..... rather than the authenticatio
setting of ASP.NET <authentication mode/>.
for your scenario, if you want to check the ASP.NET application's current
authentication mode, you can consider the following means:
1. Load the <authentication mode> setting from application's web.config
file. You can use the WebConfigurationManager class to load applicationo
configuration settings. Also, for performance consideration, you can load
this setting into a class static property at application's startup time(or
at the first time the property is requested) so as to avoid multiple
accessing to the web.config file.
2. You can check the Context.User.Identity's type, for windows
authentication, it is of "WindowsIdentity" type while for
FormsAuthentication, it could be a FormsIdentity or GenericIdentity type.
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.