Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to verify user's name and password in Windows?

Given a user's name and password, is there a way to check if the name is a valid user account on the system and if the supplied password matches the password for that user's account?


Edit: The need for this arises from the way authentication is structured in this application. The app uses the local accounts on the system to allow the users to remotely access files and stuff. My app needs a way of authenticating those users to provide them with access to its services.

like image 270
Nathan Osman Avatar asked Oct 12 '25 14:10

Nathan Osman


1 Answers

You should be able to use the LogonUser() API for this purpose... If the call fails, then either the username or password are bogus.

like image 74
Shog9 Avatar answered Oct 14 '25 07:10

Shog9



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!