Skip to main content
12-Amethyst
August 12, 2014
Question

Changing a user password in a service

  • August 12, 2014
  • 4 replies
  • 2646 views

Can I change a user's password from a service? 

I have tried this.


var newPassword="pickles"

var params = {

data: newPassword

};


// result: STRING

var encryptedPassword = Resources["EncryptionServices"].Encrypt({

data: newPassword

});


Users["testuser1"].password=encryptedPassword


But the property password does not exist.




    4 replies

    5-Regular Member
    August 12, 2014

    Hi Bill,

    If you go to entities and find the user you would like to set the password for, there is a code snippet named, ChangePassword, that can be used to change the password of a user that already has a password assigned. It requests the current password before allowing you to change it as a security measure. This is the one you would typically use. Alternatively, there is also the service, AssignNewPassword, which doesn't require the old password before assigning a new one. This would be useful in fewer cases and would most likely be used for administrative purposes if a password was forgotten. 


    Thanks,

    Saeed



    1-Visitor
    July 6, 2015

    Hello Saeed,

    Why can't i find ChangePassword  or AssignNewPassword snippet?


    Thanks,

    Alex

    1-Visitor
    July 6, 2015

    They are both part of the User object.

    So if you go to the Entities tab and find a user, in the Services you'll find these two.