473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How do I validate user credentials

I'm writing a C# program that needs to validate an Active Directory
username/password? The program will be running on a workstation that is not
part of the domain. It doesn't have to do anything else other than determine
if the credentials are valid. Any pointers would be appreciated.
Jul 21 '05 #1
4 7694
On Tue, 2 Mar 2004 18:33:53 -0400, "Paul Steele" <pa*********@acadiau.ca> wrote:

¤ I'm writing a C# program that needs to validate an Active Directory
¤ username/password? The program will be running on a workstation that is not
¤ part of the domain. It doesn't have to do anything else other than determine
¤ if the credentials are valid. Any pointers would be appreciated.
¤

I don't see how this is possible unless the workstation can talk to the domain either directly or
indirectly. One indirect method might be to contact a web service or remote object that is in the
domain through which you are attempting to authenticate.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #2
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:7s********************************@4ax.com...
On Tue, 2 Mar 2004 18:33:53 -0400, "Paul Steele" <pa*********@acadiau.ca> wrote:
¤ I'm writing a C# program that needs to validate an Active Directory
¤ username/password? The program will be running on a workstation that is not ¤ part of the domain. It doesn't have to do anything else other than determine ¤ if the credentials are valid. Any pointers would be appreciated.
¤

I don't see how this is possible unless the workstation can talk to the domain either directly or indirectly. One indirect method might be to contact a web service or remote object that is in the domain through which you are attempting to authenticate.


The workstation does have access to the domain (such as the domain
controller) so that should not be an issue (I hope). I've just haven't
figured out how to do within my C# program. I've found lots of examples that
I thought would work but no luck so far. There's got to be a way to validate
credentials in this sort of situation.
Jul 21 '05 #3
I solved my own problem. Here's the sample code:

try
{
IADsOpenDSObject user = (IADsOpenDSObject)Utils.GetObject("WinNT:");
user.OpenDSObject("WinNT://ad.acadiau.ca",username,password1,
(int)ADS_AUTHENTICATION_ENUM.ADS_SECURE_AUTHENTICA TION);
return true;
}
catch
{
return false;
}

"Paul Steele" <pa*********@acadiau.ca> wrote in message
news:c2***********@poseidon.acadiau.ca...
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:7s********************************@4ax.com...
On Tue, 2 Mar 2004 18:33:53 -0400, "Paul Steele"
<pa*********@acadiau.ca> wrote:

¤ I'm writing a C# program that needs to validate an Active Directory
¤ username/password? The program will be running on a workstation that
is not
¤ part of the domain. It doesn't have to do anything else other than determine
¤ if the credentials are valid. Any pointers would be appreciated.
¤

I don't see how this is possible unless the workstation can talk to the

domain either directly or
indirectly. One indirect method might be to contact a web service or

remote object that is in the
domain through which you are attempting to authenticate.


The workstation does have access to the domain (such as the domain
controller) so that should not be an issue (I hope). I've just haven't
figured out how to do within my C# program. I've found lots of examples

that I thought would work but no luck so far. There's got to be a way to validate credentials in this sort of situation.

Jul 21 '05 #4
On Wed, 3 Mar 2004 13:33:53 -0400, "Paul Steele" <pa*********@acadiau.ca> wrote:

¤ I solved my own problem. Here's the sample code:
¤
¤ try
¤ {
¤ IADsOpenDSObject user = (IADsOpenDSObject)Utils.GetObject("WinNT:");
¤ user.OpenDSObject("WinNT://ad.acadiau.ca",username,password1,
¤ (int)ADS_AUTHENTICATION_ENUM.ADS_SECURE_AUTHENTICA TION);
¤ return true;
¤ }
¤ catch
¤ {
¤ return false;
¤ }
¤

Looks like you're using the COM based ADSI implementation. You can also use the .NET
System.DirectoryServices library:

http://msdn.microsoft.com/library/de...etadsearch.asp
(Authenticating to Your Directory)
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #5

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

Similar topics

2
by: Brian Madden | last post by:
Hello Everyone, This is sort of a followup to the protecting files question I asked earlier today. I would like to protect a file so that only certain users could download it from my website....
2
by: Steffen Balslev | last post by:
I tried to find a way to validate user credentials using C#, searching google and lots of other news and kb sites left me without a solution. You can use a SSPI but it's that easy to implement so...
8
by: Pete Wittig | last post by:
Hello, I am wondering if it is possible to create a networked application with C# that is seen as a windows user. For example, if Bob logged onto windows and then started the application, any...
3
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
2
by: Paul Steele | last post by:
I'm writing a C# program that needs to validate an Active Directory username/password? The program will be running on a workstation that is not part of the domain. It doesn't have to do anything...
0
by: exits funnel | last post by:
Hello, I apologize if this question is a bit vague and slightly off topic but I couldn't find an Analysis Services and/or ODBO specific newsgroup. In any event, I'm trying to address an issue...
3
by: Dmitry | last post by:
I am trying to figure out how to pass set of credentials to System.IO Challenge is: App is running under one set of credentials, but via GUI user have a chance to enter another set. I would like...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.