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 called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Changing a user password in a service

billrei
5-Regular Member

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
13-Aquamarine
(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-Newbie
(To:smanley)

Hello Saeed,

Why can't i find ChangePassword  or AssignNewPassword snippet?


Thanks,

Alex

paic
1-Newbie
(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-Newbie
(To:paic)

Thanks Pai

I was looking at wrong place

I looked at Snippets Tab > EntityServices  ,Insted.

Thanks,

Alex

Top Tags