Pankaj Dhote
Pankaj Dhote

Reputation: 17

AADB2C : Reset active directory Member Password functionality

I am trying to update azure active directory members passwords. I have tried with both Microsoft graph api and azure ad graph api. However I am not able to update members password. I have tried with all the permission. Please refer below error:

{
    "odata.error": {
        "code": "Authorization_RequestDenied",
        "message": {
            "lang": "en",
            "value": "Insufficient privileges to complete the operation."
        }
    }
}

Could you please help me to find out the solution?

Upvotes: 0

Views: 91

Answers (1)

Sa Yang
Sa Yang

Reputation: 9411

If you want to have enough privileges to reset users password, you need to assign Company Administrators Role to your Service principal. You can refer to this document to do that.

  1. Use AAD Powershell to Connect AAD:

Connect-AzureAD

  1. Get the Role of Company Administrator:

$role = Get-AzureADDirectoryRole | Where-Object {$_.displayName -eq 'Company Administrator'}

  1. Assign the role to your SP:

Add-AzureADDirectoryRoleMember -ObjectId $role.ObjectId -RefObjectId $yoursp.ObjectId

  1. Get a new access token and Rest the User Password in postman:

enter image description here

Hope this helps!

Upvotes: 1

Related Questions