Change Azure B2C user password using Graph API with Admin token only

Kofi Nimoh 21 Reputation points
2022-04-28T13:49:30.927+00:00

I understand that this method can only be used with the token acquired by the user:

POST https://graph.microsoft.com/v1.0/me/changePassword
Content-type: application/json

{
    "currentPassword": "xWwvJ]6NMw+bWH-d",
    "newPassword": "0eM85N54wFxWwvJ]"
}

Is there a similar method (supplying current and new password) that can be used with the admin token, or can a custom policy be set up in some manner that would allow something similar to be invoked in graph Api with the admin token?

We have a solution whereby user accounts are maintained via a queue. So, instructions to change claims, roles passwords etc. all end up on a queue where they are picked up and dealt with by a queue-triggered Azure function. So, it just so happens that when a user does "Change Password" as it were, the instruction will end up as a message on a queue, and the function (using an admin account) will do the changing of the password. Hence, we need this function to be available to the admin account.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,536 Reputation points Moderator
    2022-06-05T03:54:41.637+00:00

    Hello @Kofi Nimoh , admins do not need the current user password to reset it, but since the credentials are already being shared, you might want to use the ROPC flow to signin as each user to later call the /me/changePassword endpoint.

    Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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