By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,215 Members | 1,920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,215 IT Pros & Developers. It's quick & easy.

How do I validate user credentials

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.