Link to home
Start Free TrialLog in
Avatar of jamesbcox1980
jamesbcox1980

asked on

VBScript to validate a password with Active Directory

I have an internal website that specified users will be able to work in.  I also have an SQL server that stores the usernames in a table of the people that are authorized to use the site.

I want the users to be able to use their Windows password, which is controlled by Active Directory on our domain controller (server2.mydomain.com).

Here's how I need this to go:

1.  User enters a username and password.
2.  Username is checked against the SQL server to ensure the user is authorized to use the site.
3.  Username and Password are validated against Active Directory 2003 to ensure sure they match the user's actual username and password.  If so, the script will return True
4.  If the validation script returns true, a session is created which will last for one hour and extended each time the user accesses a page in the website.
5.  If the session expires, the user will be prompted to login again.

I have no idea how to simply check whether the user entered the correct password.  Can someone help me with the simple script necessary for step 3?

Thanks,
Avatar of RobSampson
RobSampson
Flag of Australia image

Hi, for this problem, it sounds like you would be better off using Windows Authentication for you ASP pages, which would authenticate any AD user, and *then* you could check if that user was in your SQL database.  If the user was listed, create the session, if not, log them off.

Regards,

Rob.
Avatar of jamesbcox1980
jamesbcox1980

ASKER

Is there no way to simply verify a password with AD?
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry I've been out of town. I'll answer a soon as I get back and have a chance to try it.
Thanks, worked like a charm
Great.  Thanks for the grade.

Regards,

Rob.