1

I am trying to work out how to allow users in the company log into a web application using AD. I have looked on some sites, and the MSDN site about this, but it is not allowing me to connect. I am wondering if there is something I am missing. I am running this application on my local development machine, trying to see if the AD solution is working, but returns a server denied response. "Unable to establish secure connection with the server". I am trying to log on using my network credentials, and the domain.

Here is the web.config settings being used:

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
</authentication>
<authorization>
  <deny users="?" />
  <allow users="*" />
</authorization>
<membership defaultProvider="MyADMembershipProvider">
  <providers>
    <add
       name="MyADMembershipProvider"
       type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
         Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
       connectionStringName="ADConnectionString"
       connectionUsername="mydomain\username"
       connectionPassword="mypassword"/>
  </providers>
</membership>

Do I have to have something else special to setup, or should I be able to debug this locally in Visual Studio while on the network, and it will allow me to authenticate properly. Any advice or clear guidance would be greatly appreciated. This is a band new topic, so completely new to me.

2
  • Hi, Iv'e never tried to mix both authentication types before but as you say your trying to connect to AD...Don't you need to switch to <authentication mode="Windows"> enable on IIS and in VS ? Commented Feb 23, 2015 at 19:56
  • you need to change your authentication mode to windows edit: Windows Authentication Provider and mix forms and windows security Commented Feb 23, 2015 at 20:03

1 Answer 1

2

As I mentioned in my comment you need to complete a few steps to get this to work. I have attached an image with a quick overview.

enter image description here

This will work locally but you may need to apply some changes in IIS when you upload to production environment.

Regards,

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.