Click here to Skip to main content
13,042,630 members (78,209 online)
Rate this:
Please Sign up or sign in to vote.
I would like to take the simple "My ASP.NET Application" that Visual Studio 2010 creates and recode the "Login.aspx" to work against Active Directory LDAP.

the other staffers would prefer that all coding for the web stuffs be done in Visual Basic and using Visual Studio 2010.

I an am extreme newbie with the above tools and have only started working with ASP about a month ago.

I've been scouring the web with google for the past few days and I have a feeling my brains are leaking out my ears - most of the working examples are in C#.

Modifying web.config with the MINIMAL amount of cruft to make a basic LDAP connection is part 1

Part 2 is modifying the HTML, VB code behind of the Login.ASPX so that it passes back to the Default.aspx the right token to say a VALID LDAP/AD user's credentials were used.

Anyone have any links?
or anyone want to volunteer code?

Rich Leonard
Posted 4-Nov-10 13:03pm
FionaDM 11-Mar-11 5:44am
Did you get a solution yet? I can do this in c# using VS2008 but not VS2010.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You don't need to recode your Login.aspx to work against Active Directory.
You need to create a .NET membership provider based on the active directory.

Look into this article:

Active directory membership

Your code will stay almost the same. There are some limitations comparing regular aspnet membership provider and active directory membership provider. But you will have to do your home work.
aidin Tajadod 7-Nov-10 1:32am
Thanks, good link.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi RMLeonard,

As I underestood you want windows authentication in your
So I think you just need to add these code in your web.config:

<authentication mode="Windows"/>
    <deny users="Anonymous"/>

and set your IIS to do the rest.
RMLeonard 5-Nov-10 11:16am
Not exactly -
I cannot rely on the person at the keyboard being the person who is supposed to be at the keyboard, and managers at home with who knows what at their hands will want to log in. we also have about 50-50 Windows vs Mac on campus. I need a full up server side authentication. Which is why I'd like a simple logon screen with the authentication tied to LDAP or AD. Yes, the windows auth does seem to work IF the person is using MSIE on windows, but I need more a universal solution.

Thank you very much though.
I'll keep digging

aidin Tajadod 5-Nov-10 11:38am
So Maybe this can help you:
System.DirectoryServices.DirectoryEntry oDE;
oDE = new System.DirectoryServices.DirectoryEntry("LDAP://" + Domain ,userName,password , System.DirectoryServices.AuthenticationTypes.Secure);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 6 Nov 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100