【问题标题】:how to change the email or password of user as admin in aws amplify for node.js如何在 aws amplify for node.js 中以管理员身份更改用户的电子邮件或密码
【发布时间】:2020-09-08 18:31:56
【问题描述】:

每个人。 我正在使用带有 aws amplify 的反应应用程序进行开发。 对于用户身份验证,我使用的是 aws cognito。 在我通过 cognito 上的管理员帐户创建用户帐户后,我还不能在那里以管理员身份更改用户的电子邮件和密码。 我该怎么做?

【问题讨论】:

    标签: node.js reactjs amazon-cognito aws-amplify


    【解决方案1】:

    您可以通过以下方式进行操作。但请确保在配置 cognito 时,以下字段 [您要更改的字段] 设置为可变的。请点击这两个链接,它们可能会有所帮助 (Congito Attributes) 和 (adminUpdateUserAttributes)。

    var params = {
      UserPoolId: '',//YOUR UserPoolID
      Username: '',//username
      UserAttributes: [
        {
          Name: "email",
          Value: ``,//NEW Email
        },
        {
          Name: "name",
          Value: ``,//New Name
        },
        {
          Name: "phone_number",
          Value: ``,//New Phone
        },
      ],
    };
    const cognitoClient = new AWS.CognitoIdentityServiceProvider();
    var createPromise = cognitoClient.adminUpdateUserAttributes(params).promise();
    await createPromise;
    

    【讨论】:

      猜你喜欢
      • 2014-07-13
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 1970-01-01
      • 2014-10-23
      • 2015-07-18
      相关资源
      最近更新 更多