Last post Sep 30, 2015 09:08 AM by ryanbesko
Sep 29, 2015 03:03 PM|longmatch|LINK
I am developing an internet site but I was asked to use credentials in active directory to authenticate users - the single-sign on. When users inside our network, they should be automatically authenticated. If they are outside our network, username and password
(from active directory) should be used. I am using vb asp.net. Hopefully experts here can give me some suggestions.
Sep 29, 2015 04:41 PM|ryanbesko|LINK
This is browser specific behavior.
Chrome: Will automatically pop up window asking for credentials, regardless of being on your local network or not.
Firefox: Will automatically pop up window asking for credentials, regardless of being on your local network or not.
Internet Explorer: This is specific to the security zone your site is running in. Go to Internet Options, click the Security tab, select a Zone and click Custom Level. Scroll all the way to the bottom of the Settings section and look at the options for
Sep 29, 2015 05:10 PM|longmatch|LINK
Thank you for your quick response.
My question is actually how to use AD (active directory) credentials to authenticate users in my ASP.NET code.
It can be done in ASP.NET 2.0 and 3.5 （https://msdn.microsoft.com/en-us/library/ms180890(v=vs.90).aspx）. Not sure how it can be done in ASP.NET 4.5.
Sep 29, 2015 08:33 PM|ryanbesko|LINK
Ok. My first response still applies. You asked about being asked for credentials when you aren't on your local network, but being automatically logged in when you are on your local network.
Every version of .NET allows for Windows Auth, which is what AD is.
Open your site in IIS and enable Windows Auth under the IIS section. Then set permissions using the .NET Auth icon under the ASP.NET icon at the top. This will edit your Web.config file accordingly. That is the easiest way to learn what it takes. In
the end, it's changes in your Web.config file, and the procedure I just described does it for you.
You can even set up a playground type of site and get the settings you need working.
Sep 30, 2015 12:38 AM|longmatch|LINK
Thanks, Ryanbesko! Do you have a sample website or link to share? I am using ASP.NET 4.5 - Visual studio 2013.
Sep 30, 2015 09:08 AM|ryanbesko|LINK
As I said this is not related to .NET or Visual Studio. It's just changes to your Web.config file, which is easiest to do through IIS. Here is the result of doing such changes through IIS:
<authentication mode="Windows" />
<deny users="?" />