?
Solved

How do I authenticate form username/password against domain using Active Directory?

Posted on 2004-11-16
14
Medium Priority
?
4,231 Views
Last Modified: 2008-02-01
Using active directory, I need to know, in vb.net (not C#), how to authenticate the username and password from a login form.

I support the company intranet website and I need further security applied to the website by authenticating the user and password every time the user access the website.  

Please show example...in vb.net (not c#)  Thank you.
0
Comment
Question by:seckel
  • 3
  • 3
  • 3
  • +4
14 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12594596
     <TABLE id="Table1" cellSpacing="0" cellPadding="5" width="250" border="1">
                                          <TR>
                                                <TD width="90">Password</TD>
                                                <TD style="TEXT-ALIGN: right" width="140">
                                                      <asp:TextBox id="Password" runat="server" CssClass="ThinInput" MaxLength="12" Columns="4" Width="137px"
                                                            TextMode="Password"></asp:TextBox></TD>
                                          </TR>
                                          <TR>
                                                <TD colSpan="2" align="right">
                                                      <asp:Button id="ProcessLogin" runat="server" CssClass="ThinButton" Text="Login"></asp:Button></TD>
                                          </TR>
                                          <TR>
                                                <TD colSpan="2">
                                                      <asp:Label id="InvalidPassword" runat="server" Visible="False" ForeColor="Red" Font-Size="Larger">Invalid password.</asp:Label></TD>
                                          </TR>
                                    </TABLE>
---------------------------------------------------------------------------------------------------
   Private Sub ProcessLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProcessLogin.Click
        If Password.Text = "8888" Or Password.Text = "pokey1" Then
            Web.Security.FormsAuthentication.RedirectFromLoginPage("Admin", False)
            Response.Redirect("ManageOrders.aspx")
        Else
            InvalidPassword.Visible = True
        End If
    End Sub

Aeros
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 12594597
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12594609
oops sorry thought you asked for forms authentication
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Expert Comment

by:ihenry
ID: 12594707
Hello seckel,

If I understand your question correctly, you need something like forms authentication where user enter their user name and password to login your intranet site. And currently the intranet site is using windows authentication. Am I right? please clarify.
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12594788
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 12595563
The following MSDN Article describes exactly what you are trying to do:

Title: Active Directory Authentication from ASP .NET
URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/active_directory_authentication_from_asp__net.asp

HTH, Nauman.
0
 

Author Comment

by:seckel
ID: 12596577
ihenry

I have a form that will get the user's name and password.  I then need to authenticate the user name and password against Active Directory (ADSI)...I know how to create the form, I need help with the ADSI logic portion...
0
 

Author Comment

by:seckel
ID: 12596601
nauman_ahmed

The link is good, but in C#.  I need to know how to do this in vb.net.
0
 
LVL 20

Accepted Solution

by:
ihenry earned 2000 total points
ID: 12600199
0
 

Author Comment

by:seckel
ID: 12603554
ihenry,

You are a genius!  That was just what I needed.  Thanks.
0
 
LVL 20

Expert Comment

by:ihenry
ID: 12603753
nah...just glad I could help :0)
0
 
LVL 3

Expert Comment

by:Timothy Golden
ID: 12822968
ok so how do you get the LDAP path?
Dim adPath as String = "LDAP://DC=..,DC=.." 'Path to your LDAP directory server

i have tried this one:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;326340

but i don't know what to use for Path to your LDAP directory server

Dim adPath as String = "LDAP://DC=..,DC=.." 'Path to your LDAP directory server
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 12826478
Check the following tutoria:

URL: http://www.codeproject.com/aspnet/adsi1.asp

You can define it as
LDAP://IP_ADDRESS
LDAP://DOMAIN_NAME

HTH, Nauman.
0
 

Expert Comment

by:flatfoot64
ID: 13947258
This was the format I needed:

LDAP://domain.ccc-xxxx.net
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question