question

BizAdmin-3471 avatar image
0 Votes"
BizAdmin-3471 asked amanpreetsingh-msft commented

Need to change the password for single user by using Graph API but getting permission issues.

Hello,

I am using Graph API for microsoft 365 login, and i am trying to change password by normal user of organization.


Error - 99171-screenshot-3.jpg


Api Call - 99085-screenshot-5.jpg


I have given permission to app with admin consent -

99181-screenshot-6.jpg


Its works only for Admin user, but not other normal user. and when i give Helpdesk Administrator role to normal user, so its allow to reset password. but i cant give every single user as Helpdesk Admin for reset the password. I am struggling from 2 days to make this thing work, even i called Microsoft support tech engg, they also sound helpless. Plz help.


azure-active-directory
screenshot-3.jpg (86.1 KiB)
screenshot-5.jpg (66.5 KiB)
screenshot-6.jpg (160.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
1 Vote"
amanpreetsingh-msft answered amanpreetsingh-msft commented

Hi @BizAdmin-3471 · Thank you for reaching out.

Patch call to /me endpoint cannot be used for this purpose, which is why you are getting 403 error. Please update your code to make a Post call to /changePassword endpoint as mentioned below:

Call: POST https://graph.microsoft.com/v1.0/me/changePassword
Body: { "currentPassword": "current-value", "newPassword": "new-value" }
Permission required: Directory.AccessAsUser.All


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, Its working finaly. Thanks Aman 22 ji. ;)


99163-screenshot-7.jpg


1 Vote 1 ·
screenshot-7.jpg (26.7 KiB)

@BizAdmin-3471 · Thank you for the confirmation. :)

0 Votes 0 ·