cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Changing a user password in a service

billrei
12-Amethyst

Changing a user password in a service

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 4
smanley
14-Alexandrite
(To:billrei)

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



alexf1
1-Visitor
(To:smanley)

Hello Saeed,

Why can't i find ChangePassword  or AssignNewPassword snippet?


Thanks,

Alex

paic
12-Amethyst
(To:alexf1)

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.

alexf1
1-Visitor
(To:paic)

Thanks Pai

I was looking at wrong place

I looked at Snippets Tab > EntityServices  ,Insted.

Thanks,

Alex

Announcements


Top Tags