diff --git a/changelog/unreleased/graph-me-changepw.md b/changelog/unreleased/graph-me-changepw.md new file mode 100644 index 00000000000..607ae4848a2 --- /dev/null +++ b/changelog/unreleased/graph-me-changepw.md @@ -0,0 +1,7 @@ +Enhancement: Add /me/changePassword endpoint to GraphAPI + +When using the builtin user management, allow users to update their own password via +the graph/v1.0/me/changePassword endpoint. + +https://github.com/owncloud/ocis/issues/3063 +https://github.com/owncloud/ocis/pull/3705 diff --git a/docs/extensions/graph/users.md b/docs/extensions/graph/users.md index 2b5e18dc040..d8715d7b792 100644 --- a/docs/extensions/graph/users.md +++ b/docs/extensions/graph/users.md @@ -163,3 +163,27 @@ to be updated. E.g. to update the `displayName` Attribute: ``` Similar to creating a user via `POST`, the `PATCH` request will return the user object containing the new attribute values. + +### Change password + +#### `POST /me/changePassword` + +Users can change their own password by sending a POST request to `/me/changePassword` + +##### Request Body + +``` +{ + "currentPassword": "current", + "newPassword": "new" +} + +``` + +When successful the API returns no response body and the HTTP status code 204 (No Content) + +``` + curl -i -k --header "Content-Type: application/json" \ + --request POST --data '{"currentPassword": "current", "newPassword": "new" }' \ + 'https://localhost:9200/graph/v1.0/me/changePassword' -u user:current +```