Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET HTML VB.NET
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
Comments
FionaDM at 11-Mar-11 5:44am
   
Rich
Did you get a solution yet? I can do this in c# using VS2008 but not VS2010.
Maj
Rate this: bad
good
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.
  Permalink  
Comments
aidin Tajadod at 7-Nov-10 1:32am
   
Thanks, good link.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi RMLeonard,
 
As I underestood you want windows authentication in your asp.net.
So I think you just need to add these code in your web.config:
 
<authentication mode="Windows"/>
<authorization>
    <deny users="Anonymous"/>
</authorization>
 
and set your IIS to do the rest.
  Permalink  
Comments
RMLeonard at 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
 

Rich
aidin Tajadod at 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
0 Sergey Alexandrovich Kryukov 459
1 Nirav Prabtani 338
2 Abhinav S 170
3 PIEBALDconsult 160
4 Pikoh 140
0 OriginalGriff 7,640
1 Sergey Alexandrovich Kryukov 6,836
2 Maciej Los 3,919
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 6 Nov 2010
Copyright © CodeProject, 1999-2014
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