AD Authentication for logging in

Jan 11, 2013 at 7:50 PM

Hey guys,

I will be setting this forum up internally at a Microsoft shop, so I would like for users to be able to register using their Active Directory user name and password.  It seems like from the documentation I have read this might be possible by setting formsAuth to true, and then configuring ASP.Net Membership.  However, I have looked through the MS documentation on setting up this Membership, and I am not seeing anything that looks like it applies to this type of setup.

So my question is...is it possible to use AD authentication with NearForums?  If so, is there an article or documentation that walks you through configuring this?

Thanks

Coordinator
Jan 14, 2013 at 9:31 AM

Hi,

Nearforums supports any (ASP.NET) membership provider, at least it supposed to :)

You should follow the instructions from http://msdn.microsoft.com/en-us/library/ff650308.aspx#paght000026_step3 , step 3 (set LDAP conn string and membership provider).

 

Kind Regards,

Jorge

 

Jan 15, 2013 at 5:38 PM

Thanks for the response,

I had come across that documentation from another post on your forum and set it all up.  Once I made the changes, the site launches fine and no errors.  However, at this point, I am not sure how the site is supposed to work.  What I was hoping is that you enable Windows Auth in IIS, and then the user browses to the site, it picks up the credentials and allows access or similar.  However, I am not seeing any different behavior in Nearforms.  It still prompts you to register for an account or login using your Nearforums account or Facebook or Twitter.  Does something need to be modified to change the behavior of the Nearforms site?

 

 

 

Coordinator
Jan 16, 2013 at 9:40 AM

Hi,

Nearforums supports any membership provider via forms-based authentication. You will not be able to automatically authenticate in the application. Instead, the user must go to the login page and enter the AD credentials.

Like this: http://www.christowles.com/2011/04/aspnet-forms-based-authentication-with.html

Kind Regards,

Jorge

Jan 16, 2013 at 1:20 PM

Ha...that is funny.  It actually worked and I didn't even know it because I thought I would need to use some different login mechanism.  Sorry, my brain was going in a completely different direction.  Thanks for the help.

 For anyone else trying to do the same, below are the changes I made to the web.config file:

Under <system.web>, change:

<authentication mode="Forms" /> 

to

<authentication mode="Windows" />

And change:

<membership defaultProvider="ForumsMembershipProvider">

to

<membership defaultProvider="MyADMembershipProvider">

 

Under <connectionStrings>, add:

<add name="ADConnectionString" connectionString="LDAP://dc.somecompany.com:389/DC=somecompany,DC=com" />

 

Under <providers>, add:

<add name="MyADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnectionString" connectionUsername="domain\someuser" attributeMapUsername="SAMAccountName" connectionPassword="myPassword" connectionProtection="None"/>

 


Coordinator
Jan 16, 2013 at 1:34 PM

WOW!

I didn't think that was possible for Nearforums!

 

Thanks for sharing!