Error changing password using Microsoft graph API in a chatbot application - code:"Request_BadRequest" - message:"An error occurred while processing the change password request."

Sara Chreim 1 Reputation point
2022-01-11T10:19:08.633+00:00

I am trying to change my office account password using Microsoft graph API in a chatbot application.
I added the permission: Directory.AccessAsUser.All and I am logging in successfully.

Here is my request:

163913-screenshot-2022-01-11-115147.png

This is the error I am getting:

163895-screenshot-2022-01-11-115312.png

Any one can help? It is urgent!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,857 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JanardhanaVedham-MSFT 3,541 Reputation points
    2022-02-06T01:34:29.383+00:00

    Hi @Sara Chreim ,

    I have tested the below Microsoft Graph Change Password API and any user can update their password without belonging to any administrator role using delegated permission scope. It worked fine for both an admin user and a normal user from my app in Postman API tool.

    POST https://graph.microsoft.com/v1.0/me/changePassword  
    

    Example of a Success Response Screenshot from Postman API tool :

    171633-image.png

    I would advise you to cross verify the below:

    1. Validate your user access token has "Directory.AccessAsUser.All" permissions associated or not. You can verify it using this : https://jwt.ms/
    2. Ensure that user password is not expired.
    3. Also ,you can verify Change Password Graph API in Postman API tool outside of your application by passing the only required request header parameters.
      171578-image.png

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any further questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.