无论出于何种原因,我都无法使用adminUpdateUserAttributes
for cognito从本地计算机使用Node正确更新属性。
我的代码是:
const params = {
UserAttributes: [
{
Name: "name",
Value: "name edited"
}
],
Username: "USERNAME",
UserPoolId: "POOLID"
};
var service = new AWS.CognitoIdentityServiceProvider();
service.adminUpdateUserAttributes(params, function(
err,
data
) {
if (err) console.log(err, err.stack);
// an error occurred
else console.log(data); // successful response
});
如果我启动它,我将在输出中显示
message: 'Not Found',
code: 'UnknownError',
statusCode: 404,
time: 2019-03-27T16:04:48.002Z,
requestId: 'REQIDHERE',
retryable: false,
我很有趣,我使用aws
命令从命令行尝试了这一点,并且效果很好:
aws cognito-idp admin-update-user-attributes --user-pool-id eu-POOLID --username USERNAME --user-attributes Name=name,Value="name edited"
如何进行调试/修复? USERNAME和POLLID是正确的,所以我想知道那里出了什么问题。