Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Verify User's credentials

Reply
Thread Tools

Verify User's credentials

 
 
John Beschler
Guest
Posts: n/a
 
      09-18-2009
I am developing a WEB-based employee evaluation app that reuires the
supervisor and employee have a "face-to-face". To confirm that this has been
accomplished, I want to have a form that the employee and the supervisor will
both "sign" electronically during the same session. To do that, obviously, I
need to validate both users.

My plan is to allow the users to enter their AD usernames/passwords and
validate them against the domain. I have found a few examples of how to do
that using VB but none using C#. Can anyone help me with this please?

Thanks,
John
 
Reply With Quote
 
 
 
 
John Beschler
Guest
Posts: n/a
 
      09-18-2009
Thanks Mark. That worked perfectly!

"Mark Rae [MVP]" wrote:

> "John Beschler" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > My plan is to allow the users to enter their AD usernames/passwords and
> > validate them against the domain. I have found a few examples of how to do
> > that using VB but none using C#. Can anyone help me with this please?

>
> using System;
> using System.Collections.Generic;
> using System.DirectoryServices;
>
> /// <summary>
> /// Validates a logon request against the current domain
> /// </summary>
> /// <param name="pstrUser">User account without domain name</param>
> /// <param name="pstrPassword">Password</param>
> /// <returns>Boolean</returns>
> bool Logon(string pstrUser, string pstrPassword)
> {
> try
> {
> using (DirectoryEntry objADEntry = new DirectoryEntry("LDAP://" +
> System.Environment.UserDomainName, pstrUser, pstrPassword))
> {
> return !objADEntry.NativeObject.Equals(null);
> }
> }
> catch (System.Runtime.InteropServices.COMException)
> {
> return false;
> }
> catch (Exception)
> {
> throw;
> }
> }
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to verify if an employee truely has an MCSE =?Utf-8?B?Qm9kaW5lOTU=?= Microsoft Certification 8 01-15-2010 06:52 AM
OpenLDAP --- accessing to verify Username, Password, Organization and one or two other credentials. Does someone have an example, please? John Apps ASP .Net Security 0 05-19-2008 06:44 PM
"The credentials supplied conflict with an existing set of credentials" -=rjh=- NZ Computing 2 07-15-2006 11:09 PM
Is there a way to verify wireless router connection =?Utf-8?B?Uko=?= Wireless Networking 1 05-18-2005 01:03 PM
Need to verify an ATA/ATAPI-6 device Fred VHDL 0 11-12-2003 02:18 PM



Advertisments