?
Solved

Use Active Directory as User Authentication

Posted on 2002-05-14
6
Medium Priority
?
325 Views
Last Modified: 2010-05-02
I would like to authenticate users of an in-house application using Active Directory on the Windows 2000 server.  I would like to set up groups that users could be added to in order to gain access to the system.

I am looking for code samples, login forms, examples and tips on how to achieve this.  
0
Comment
Question by:ChiefDamon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:pjbaratelli
ID: 7011817
To create a group:

1) Open active directory.  
2) Highlight the domain where the application is located
3) Right click the domain -> New -> Group
4) Enter in Group Name and Group Name (Pre-Windows 2000)
5) Choose Group Scope (I'd leave the default Global)
6) Choose Group Type (You want the default, security)
7) Select OK

This will create a group.

Apply the group to the in-house application permissions.
Place all users that have access into that group.

You shouldn't have to code for this and windows has a standard logon form it uses that is perfectly fine.

If the application is a web application, use frontpage to add the group to the web permissions and dissallow anonymous access.



0
 

Author Comment

by:ChiefDamon
ID: 7012359
Once you add a user to the group you will need to check the users group membership prior to opening the application.  The comment by pjbaratelli approaches adding the group memberships but states that a standard windows login will do for checking the memberships.  
I am using VB6 and see no such default form so I guess my question is:
How do I check active directory memberships within a VB application?
0
 
LVL 1

Expert Comment

by:falconew
ID: 7012776
listening
0
Independent Software Vendors: 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!

 

Author Comment

by:ChiefDamon
ID: 7013517
Very productive comment falconew.  Maybe you could explain further.
0
 

Author Comment

by:ChiefDamon
ID: 7013617
Added a new question that is more specific to the code required to search Windows 2000 Active directory using ADO and ADSI to determine an users group memeberships.
0
 
LVL 1

Accepted Solution

by:
falconew earned 600 total points
ID: 7015445
Hi ChiefDamon,

I don't think you can authenticate a user by coding it by yourself, because there's no such method in documentation explaining about that. Logon authentication must be made at the first time a user login to windows.
To determine a user in specific group you can use ADO and ADSI, please refer to MSDN documentation.
This is a sample to check whether a user Bill Gate is a group of Accounting:

Dim strGroup
Dim oGroup
Dim arrmembers
Dim i
Dim member
Dim name
Dim GrupMember
Dim userName

userName="Bill Gate"
strGroup = "LDAP://cn=ACCOUNTING,cn=Users,DC=asiasoft,DC=com"
Set oGroup = GetObject(strGroup)
arrmembers = ""
arrmembers = oGroup.GetEx("member")
If IsArray(arrmembers) Then
    For i = LBound(arrmembers) To UBound(arrmembers)
        If GrupMember = false Then
            member = Split(arrmembers(i), ",")
            name = Split(member(0), "=")
            If UCase(UserName) = UCase(name(1)) Then
                GrupMember = true
            End If
         End If
    Next
End If
Set oGroup = Nothing
if GrupMember=true then
    msgbox "Group Accounting"
else
    msgbox "Not Group Accounting"
end if

hope this help...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

752 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