Reputation: 977
In my program, I'm attempting to use Windows Authentication, which I have never used before and so am pretty confused. I've followed what I think I should do and what I've found in my google searches by adding this in my Web.config
:
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
</authorization>
and my IIS settings look like this:
but whenever I run my website, it just loads up correctly when I believe I should be getting a popup that asks for my username/password. How can I fix this? Thanks
Upvotes: 1
Views: 1923
Reputation:
You should get a popup if you try with Firefox, Seamonkey and probably Chrome. If you want a popup with the Internet Explorer, try this:
Tools | Internet options | Security | Local intranet (or some other zone) | Custom level | user authentication | Prompt for user name and password
EDIT: You an find Tools on the menu bar. If you don't see menu bar, open it by right click somewhere near tabs and enable Menu bar. See screenshots:
Upvotes: 3
Reputation: 368
I did something very similar just few days ago, what I did is following, in my login form process
using System.DirectoryServices.AccountManagement;
public bool Login(string user, string password) {
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "YOUR DOMAIN WITH ACTIVE DIRECTORY"))
{
return pc.ValidateCredentials(user, password);
}
}
I am hoping this helps you out! Best of luck!
Upvotes: 0