user3587624
user3587624

Reputation: 1471

Check if Windows Username and Password is correct in NodeJs

I have a NodeJs application with certain parameters. Some of them are a Username and a Password.

I am trying to figure out whether there is a way I can check if the Password provided for the given UserName is the right one according to Active Directory.

On my C# application, I can do something like this

bool isValid = pc.ValidateCredentials(UserName, Password, ContextOptions.Negotiate);

but... how to do something similar in NodeJs?

EDIT: In other words, I am trying to figure out given a UserName and Password that are part of a Windows domain, check whether the password is correct.

Example: UserName: [email protected] PassWord: password123!

I am wondering how to validate windows domain credentials using NodeJS

Upvotes: 1

Views: 2211

Answers (1)

Adelin
Adelin

Reputation: 8219

You need an Active Directory lib that you can use in NodeJS.

A few samples include:

Basically, through LDAP (packages of LDAP on npm) you could check if you are able to make a simple bind with the Active Directory, and therefore if the credentials are working.

Upvotes: 1

Related Questions