Create user with password via REST API

I F asked on December 6, 2014 00:29

I'm new to Kentico and I am working on integrating an external site with a Kentico site.

What I need is to be able to create a new user from the external site via the Kentico REST API. I have this working and I am accomplishing that by POSTing user data to the API as follows:

POST endpoint:

~/rest/cms.user/currentsite?format=json

POST data:

{
    "UserName":"user@domain.com",
    "FullName":"John Doe",
    "Email":"user@domain.com",
    "UserEnabled":true
}

This appears to work just fine.

However, I'm not including a password and the user that is created has an empty password. When I attempt to include a password field, I always get a 400 "Bad Request" response from the server.

Since this doesn't work, I assume I would need to make a second call to set the user password. However I can't find an appropriate REST object that would allow me to set the password. I don't see anything that would resemble the "UserInfoProvider" that would normally be used to set the user password.

Is it possible to set the user password from the REST API? If so, what would be the correct object to use to set the password for the user?

Correct Answer

I F answered on December 8, 2014 17:02

I got this figured out.

Silly me forgot to check the "Allow sensitive fields for administrators" setting in the REST integration settings section. Once I did that and included the "UserPassword" field in my request, then the password was set for the user.

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.