NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing User Passwords / Privileges via API

Solved!
Go to solution

G'Day Elaine - great to hear from you!  Yep, that's exactly what I needed - thanks so much!

 

PS: sorry for my late replyve had a bunch of stuff to do in another area in the application.





Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 11 of 13
(1,142 Views)

Setting directly this property will not scramble the password which is quite a bad idea.

This stored value is supposed to be scrambled, which means that if you try to login with this not scrambled password, the login will fail.

This proper way is to set the User.Password which will scramble the password automatically.

0 Kudos
Message 12 of 13
(325 Views)

I know this thread is old, but I want to add my 2 cents.  Working on a custom runtime User Manager where I want the user to edit the passwords and I used the trick here to set the password directly using the API function SetValString().  

 

I having a bunch of issues confirming password entered by using in a custom dialog matched the saved one.   Found out when you do the function ValidatePassword() it actually expecting the password to be scrambled. 

 

  • If using scrambled password use the ValidatePassword()..  I am getting Locals.Password from a dialog that the user is inputting and the rest of the code is in FrontEndCallbacks().

         Locals.PasswordValid = RunState.Engine.GetUser(Locals.Username).ValidatePassword(Locals.Password),

 

  • If you are using 'unscrambled' just compare the password stored for the user with the one entered:

             Locals.PasswordValid = Locals.Password == Locals.StoredPassword

 

I plan on using unscrambled passwords going forward as it is seems impossible to edit the scrambled ones and decode them.

~Teds

0 Kudos
Message 13 of 13
(46 Views)