Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is web user authenticated through NTLM?

I'm using forms authentication and launching a site from Visual Studio 2010. It is using the Visual Studio Development (web) Server and not IIS. The web.config has:

<authenticaion mode="Forms">
  <forms name=".MyApp" protection="All" cookieless="UseCookies"/>
</authentication>

The login page is using the ASP.NET login control. Before the user even logs in, I can see following:

HttpContext.Current.Request.LogonUserIdentity.AuthenticationType == "NTLM"
HttpContext.Current.User.Identity == System.Security.Principal.GenericIdentity
HttpContext.Current.User.Identity.AuthenticationType == "NTLM"

This user seems to be authenticated as a local system user and not a web user. Doesn't this mean the user will always be authenticated, regardless if they logged into the site or not?

How is a web user NTLM?

like image 438
4thSpace Avatar asked Oct 09 '12 18:10

4thSpace


2 Answers

As far as I know cassini does does not support Windows authentication.

Its runs as a local system account and thats what you see as NTLM authenticated.

If you are developping/debugging security features for an Asp.Net application (or WCF) I highly suggest you deploy to IIS.

like image 70
Jf Beaulac Avatar answered Nov 02 '22 00:11

Jf Beaulac


If I'm not mistaken you're seeing yourself as being the User (being authenticated) running Visual Studio (in your user context) when you are debugging using VS and it's dev server.

Visual Studio runs in your context (your Windows user account/permissions, etc.) - Request.LogonUserIdentity.User

It shouldn't affect your debugging of Web Forms/Forms Authentication. After successful Forms Auth Login, you can obtain HttpContext.User.Identity.Name of the "forms auth user" (web user).

like image 35
EdSF Avatar answered Nov 01 '22 23:11

EdSF