473,498 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Logon

Dan
I am developing an application that has to have acces to
it controlled. I would like to be able to have the users
logon to the application using their existing WIndows
account. I would create a new Group on the domain and add
those users who should access the program to that group.

The problem I am having is determing how to validate their
UserID and Password and retrieve their group membership
information. Do I do this via Active Directory? Should I
do this via API calls?

Any insight or a point in the right direction would be
great. Thanks!
Nov 15 '05 #1
1 1323
Dan,

I would actually use a ServicedComponent for this. With it, you can
assign the user group to a role. Once you have the role defined, then you
can create a class which derives from ServicedComponent. Create a method,
Login. This method would do nothing. Then, you can set access for the
method to that role only. When someone outside of the role (and outside of
this user group) calls the method, it will throw an exception (granted, this
isn't the most eloquent solution).

Once you have that, you can call the LogonUser API (or LogonUserEx) to
validate a username/password combo. Then you can impersonate the user
(using the Impersonate method on the WindowsIdentity API class, the
documentation for this method will show you how to do all of this).

The benefit to doing this is that you don't have to worry about a
predefined name of a windows group (which isn't always possible). You have
to worry about a defined role in your application, which is specific to the
application, not to the domain it is running in. Then, you just have to
handle the mappings of the users and groups to the role that your
application provides.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
I am developing an application that has to have acces to
it controlled. I would like to be able to have the users
logon to the application using their existing WIndows
account. I would create a new Group on the domain and add
those users who should access the program to that group.

The problem I am having is determing how to validate their
UserID and Password and retrieve their group membership
information. Do I do this via Active Directory? Should I
do this via API calls?

Any insight or a point in the right direction would be
great. Thanks!

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4486
by: Kenneth Courville | last post by:
Hello, I have an application that will be logging to a SQL Server 2000 database user user activity from several Windows 2003 terminal servers. This information will be retrieved by monitoring...
23
9164
by: cerilocke | last post by:
I have an identical SQL database on two machines (my machine and a web server) that links to a database on a third server (S3). When I execute a stored procedure on my machine that accesses a...
4
3582
by: cmc | last post by:
Hi, I 'm new to DB2 (from Oracle background) and have some fundamental question. In Oracle, you create user account "within the database" to let user to logon to the database. There is no tie...
2
1844
by: David Mitchell | last post by:
I have a multiuser database which VBA to return the current users NT logon. The database has a table which contains the names of all users and a field called bmlogon which holds their NT logon. ...
5
20238
by: Ram | last post by:
Hey, I'v managed to set the "User Must Change Password At Next Logon" flag on the LDAP protocol, Using the - "pwdLastSet" property - by setting it to - "0" (for on) or - "-1" (for off). The...
5
2738
by: Bruno Mendonça | last post by:
My boss asked me to build a program to create a report with logon/logoff events for all users within our windows domain. I'm using .Net to do so and decided to have a program running on the Domain...
2
1852
by: tshad | last post by:
User VS 2003, I would like to use User Controls to control the page look with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and PageBottom.ascx). I would put the Content User control...
2
1534
by: spncc | last post by:
i'm making Form authenticate page to let the user first logon before using the application. However, like most security manner, the new user is needed to first logon and forced to change password...
9
2990
by: Alex | last post by:
Get the Name and Phone Number of the Current Windows User in a .NET Application I am writing a simple .NET (C#) application. It needs to "automatic" get the Name (last, first) and phone number...
20
7054
by: =?Utf-8?B?QnJpYW4gTmljaG9sc29u?= | last post by:
Hello, I'm trying to create an admin page that can run miscellaneous scripts for our IT department. Currently, I'm trying to create a script that can map a network drive for a user (e.g. a form...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.