cancel
Showing results for 
Search instead for 
Did you mean: 

change password using dotcmis

shivtechno
Champ in-the-making
Champ in-the-making

Hi ,

I facing trouble while posting data to change password some one know whate parameter required to post for change password through DotCmis.

I had worked on this kindly see the below code for refrance..

   HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create("http://ServerIp:8080/alfresco/service/api/people/changepassword/" + UserName);


                // use default credentials
                webReq.UseDefaultCredentials = true; webReq.Headers.Add("Authorization", authorization);

                // sets the method as a get
                webReq.Method = "POST";
                string RepairPassword = Password.Replace(@"/", "");
               // string NewPassword = RepairPassword.Replace(@"=", "");
                string postData = "{ userName:" + Convert.ToString(UserName) + ", password: '" + Convert.ToString(RepairPassword) + "', firstName:" + Convert.ToString(UserName) + ", lastName:'NA', email:" + UserName + ", disableAccount: false, quote: -1, groups: [] }";
                byte[] byteArray = Encoding.UTF8.GetBytes(postData);
                // Set the ContentType property of the WebRequest.
                webReq.ContentType = "application/json";
                // Set the ContentLength property of the WebRequest.
                webReq.ContentLength = byteArray.Length;
                // Get the request stream.
                Stream dataStream = webReq.GetRequestStream();
                // Write the data to the request stream.
                dataStream.Write(byteArray, 0, byteArray.Length);
                // Close the Stream object.
                dataStream.Close();

Thanks & Regards,

Shivkumar Swami

1 REPLY 1

mitpatoliya
Star Collaborator
Star Collaborator

you cannot do that using cmis as it is not part of cmis specification.

Using CMIS with Alfresco | Alfresco Documentation 

you need to use webscript to achieve that.

Update user password | Alfresco Documentation