EDN Admin
Well-known member
Hey everyone. What I want is to publish a website that is open to the world but I want to have a users only section that is logged into via the domain credentials that we use to log into our workstations in the office. Ive been following
http://msdn.microsoft.com/en-us/library/ff650308.aspx this MSDN write up about this topic. I created a really simple test application that has two pages: Login.aspx and Default.aspx <br/>
<br/>
My Web.config file is set up like this:
<pre><configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms
<forms name=".ADAuthCookie" timeout="10" />
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership>
<providers>
<add name="TestDomainADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="TestDomainConnectionString"
connectionUsername="CompanyAccountInActiveDirectory"
connectionPassword="******************"
/>
</providers>
</membership>
</system.web>
<connectionStrings>
<add name="TestDomainConnectionString" connectionString="LDAP://Server5.Company.local/DC=Company,DC=local" />
</connectionStrings>
</configuration>
[/code]
So, I got the connection string http://waleedelkot.blogspot.com/2009/01/get-active-directory-connection-string.html
by running this app on the Active Directory server - Server5. Also, I specified the Login control like this...
<pre> <asp:login id="Login1" runat="server" failuretext="Didnt work" membershipprovider="TestDomainADMembershipProvider" destinationpageurl="~/Default.aspx </asp:login>[/code]
Anyone have an idea where Im going wrong with this? Thanks in advance for your comments and suggestions.
View the full article
http://msdn.microsoft.com/en-us/library/ff650308.aspx this MSDN write up about this topic. I created a really simple test application that has two pages: Login.aspx and Default.aspx <br/>
<br/>
My Web.config file is set up like this:
<pre><configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms
<forms name=".ADAuthCookie" timeout="10" />
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership>
<providers>
<add name="TestDomainADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="TestDomainConnectionString"
connectionUsername="CompanyAccountInActiveDirectory"
connectionPassword="******************"
/>
</providers>
</membership>
</system.web>
<connectionStrings>
<add name="TestDomainConnectionString" connectionString="LDAP://Server5.Company.local/DC=Company,DC=local" />
</connectionStrings>
</configuration>
[/code]
So, I got the connection string http://waleedelkot.blogspot.com/2009/01/get-active-directory-connection-string.html
by running this app on the Active Directory server - Server5. Also, I specified the Login control like this...
<pre> <asp:login id="Login1" runat="server" failuretext="Didnt work" membershipprovider="TestDomainADMembershipProvider" destinationpageurl="~/Default.aspx </asp:login>[/code]
Anyone have an idea where Im going wrong with this? Thanks in advance for your comments and suggestions.
View the full article