Validate Windows Authentication

Below mentioned two lines of code will help you to validate windows user id from your NAV perspective. Cheers all!!, keep exploring the enormous possibilities with DotNet variable.

PrincipalContext@1002 : DotNet "'System.DirectoryServices.AccountManagement, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.DirectoryServices.AccountManagement.PrincipalContext";
ContextType@1001 : DotNet "'System.DirectoryServices.AccountManagement, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.DirectoryServices.AccountManagement.ContextType";

PrincipalContext := PrincipalContext.PrincipalContext(ContextType.Domain);
Valid := PrincipalContext.ValidateCredentials(vUserID,vPassword);


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s