PFB the steps we followed to run this:
- Enable Password Writeback and enabled the following permissions:
- Resetting On-Prem Password policy.
- Get Access Token by running Auth Code Grant via Postman :
- Fetching the access token after logging in with Password administrator account.
- As mentioned in the documentation, currently reset password is only supported with delegated permissions scope. Also, only an administrator with the appropriate permissions can perform this operation and it cannot be performed on a user's own account. Please note that UserAuthenticationMethod.ReadWrite.All delegated permissions must be granted for the APP that is registered in Azure AD. As you can see below, I have tested this reset password API in Postman API tool using delegated scope and the succesful response is being generated. You can also refer Calling Graph API from Azure Logic Apps using delegated permissions documentation for more information.
POST https://graph.microsoft.com/beta/users/{id | userPrincipalName}/authentication/passwordMethods/{id}/resetPassword
Important Note : APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.
Example Output in Postman API tool:
- The password request went successful.
- Kindly wait for an hour for on-prem changes to replicate and try logging in with new password.
Thanks,
Akshay Kaushik
Please "Accept the answer" (Yes/No), and share your feedback if the suggestion works as per your business need. This will help us and others in the community as well.