Password Reset By Administrator Issued As A REST Request

Last modified 13 Mar 2024 13:32 +01:00
Table of Contents

Description

Example of Password reset with the use of the REST interface. The password is provided inside the request body.

For the purpose of the sample we are using the CURL tool as it is a well maintained, well tested, and it’s widely accessible.

Execute Password Reset by Administrator for User

Please see note:

This example also needs a configuration change in the system global security policy. You have to enable the password reset feature in you configuration, please see this page.

curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/users/e297a878-89da-43fa-b67a-d0316975388a/credential \
-v \
--data-binary @./samples/rest/user-pwd-reset.json
Show data source example for "Execute password reset by administrator for user" | GitHub
{
  "executeCredentialResetRequest": {
    "resetMethod": "passwordReset",
    "userEntry": "5ecr3tP4s5w0rd"
  }
}

The response is an HTTP 200 code in case of success with a response body.

Show example output for "Execute password reset by administrator for user"
{
  "@ns" : "http://prism.evolveum.com/xml/ns/public/types-3",
  "object" : {
    "@type" : "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3#ExecuteCredentialResetResponseType",
    "message" : {
      "@type" : "c:SingleLocalizableMessageType",
      "key" : "execute.reset.credential.successful",
      "fallbackMessage" : "Reset password was successful"
    }
  }
}
Was this page helpful?
YES NO
Thanks for your feedback