views:

20

answers:

2
+1  Q: 

Automatic AD Auth

Hi everyone,

I'm developing an ASP .NET application, nothing fancy just another LOB App. Our company's authentication model is based on a typical AD setup. Nearly all of our applications are written on Sharepoint so it is a requirement that the authentication is "automatic", meaning that once you are logged on your machine you have access to all your applications without writing another user or pwd.

For some reasons i cannot develop this app over Sharepoint.. so, the question is How Can I Automatically Authenticate AD users on my web App?

thanks in advance

A: 
PrincipalContext Authenticator = new PrincipalContext(ContextType.Domain, 'yourDomainName');
    AuthenticationFailed = !Authenticator.ValidateCredentials(Username, Password);

If AuthenticationFailed; you can redirect to login page..

TonyP
+1  A: 

You need to enable Windows Authentication on the web app. This article has enough details to get you started.

Nasko
To enable it in IIS, the simplified version of that article: IIS Mgr -> Properties of Your Website -> Directory Security -> Edit -> Integrated Windows Authentication [IIS6]. You need to explicitly enable it for IIS7 through the "Add Role Wizard".
Nate Bross