Authenticating domain users

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have two questions. The first one is not so much ADO related, but the
second one is.

1) Assuming I have the current windows identity name, if the user gives me a
password, how can I ask the domain to authenticate that the password is
correct?

2) Once I have the user authenticated on the domain, I want to pass that
information on to a SQL Server Database with roles. Is there any way I can
check if the user is part of a role on the database? For example:

Database 'MyDatabase' has role 'rManagers'. rManagers has, as one of its
logins, the domain account 'SampleUser'.

If 'SampleUser' logs in to my program, I want to check if he is part of the
rManagers role.

Is this possible? If not, how else can I check that he has permission to do
certain things without trying to run some sort of dummy procedure?

Thanks!
 
Hi,

you mean programmatically impersonating your user to DB?

One way is with LogonUser API
http://aspalliance.com/39

Do you use ASP.NET? It also has tools to have impersonating when user logs
into application via Windows Authentication (these credentials can be
impersonated and user can try to log to DB with them, however it has some
performance implications like with connection pooling)

Hopefully this gives you something to start with.
 
Back
Top