如何解决即使授予aws.cognito.signin.user.admin Oauth权限,updateUserAttributes也不起作用
我一直在使用AWS cognito,并尝试更新preferred_username
属性。
我尝试了Auth.updateUserAttributes
通话,但没有成功。
这是整个代码:
Auth.updateUserAttributes(user,{
preferred_username: "new_username",})
.then((data) => {
setUser(data);
console.log("updateUserAttributes succ",data);
})
.catch((error) => {
console.log("updateUserAttributes err",error);
});
})
.catch((r) => console.log("getUser err",r));
我还检查了 app客户端设置,以获取对preferred_username
属性的读写权限。
仍然出现此错误:
updateUserAttributes err Object {
"code": "NotAuthorizedException","message": "Access Token does not have required scopes","name": "NotAuthorizedException",}
我也尝试了其他属性,例如website
,但得到了相同的响应。
谢谢。
更新
似乎来自外部身份提供商的用户无法更新其属性here。
有人可以确认或否认吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。