开发者

Automatic AD Auth

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 dev开发者_如何学运维elop this app over Sharepoint.. so, the question is How Can I Automatically Authenticate AD users on my web App?

thanks in advance


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


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

If AuthenticationFailed; you can redirect to login page..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜