我正在尝试使用以下资源来更改用户密码:
用户以前是用邀请资源创建的:
访问令牌有权限:Directory.accessasuser.all。
代码如下:
graphClient().me()
.changePassword(UserChangePasswordParameterSet
.newBuilder()
.withCurrentPassword(currentPassword)
.withNewPassword(newPassword)
.build())
.buildRequest()
.post()
我会收到错误:
"Incorrect password. Password provided does not match the
old password. paramName: oldPassword, paramValue: , objectType: System.String"
直接由HTTP请求API时,我会遇到相同的错误。
我确定当前密码是正确的。
如果用户的密码程序fofile先前已更新,则更改密码有效:
https://learn.microsoft.com/en-us/graph/api /user-update?view = graph-rest-1.0& tabs = http#example-3-update-the-passwordprofile of-a-user-user-user-uset-to-reset-their-password
为什么用户可以' t接受邀请后更改密码?
I'm trying to change user's password with the following resource:
https://learn.microsoft.com/en-us/graph/api/user-changepassword?msclkid=9549af45bca611ecbef12e519c4fdf2c&view=graph-rest-1.0&tabs=http
The user is previously created with invitations resource:
https://learn.microsoft.com/en-us/graph/api/invitation-post?view=graph-rest-1.0&tabs=http
The access token has permission: Directory.AccessAsUser.All.
The code goes as follows:
graphClient().me()
.changePassword(UserChangePasswordParameterSet
.newBuilder()
.withCurrentPassword(currentPassword)
.withNewPassword(newPassword)
.build())
.buildRequest()
.post()
I get the error:
"Incorrect password. Password provided does not match the
old password. paramName: oldPassword, paramValue: , objectType: System.String"
I get the same error when requesting api directly by http.
I'm sure the current password is correct.
Changing password works if users's passwordProfile is previously updated with resource:
https://learn.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http#example-3-update-the-passwordprofile-of-a-user-to-reset-their-password
Why a user can't change password after accepting the invitation?
发布评论