简体   繁体   English

如何在 AWS Cognito 用户池中为特定用户编辑用户属性?

[英]How to edit user attributes in AWS Cognito User Pool for specific user?

I'm using AWS Cognito User Pool and have created some users.我正在使用 AWS Cognito 用户池并创建了一些用户。 Now I would like to change some of the attributes for a specific user such as name, address, etc...现在我想更改特定用户的一些属性,例如姓名、地址等...

Is it possible to do this on an AWS Website?是否可以在 AWS 网站上执行此操作? If so, how?如果是这样,如何?

The console does not have that capability but it can be done in the AWS Command Line Interface.控制台没有该功能,但可以在 AWS 命令​​行界面中完成。

aws cognito-idp admin-update-user-attributes \
    --user-pool-id xxx \
    --username yyy \
    --user-attributes Name=xxx,Value=yyy Name=ttt,Value=sss ...

Custom attributes use the following syntax:自定义属性使用以下语法:

--user-attributes Name="custom:attributeName",Value="value with space"

You need to set up your credentials with cli first (only the first time), via the command:您需要首先(仅第一次)通过以下命令使用 cli 设置您的凭据:

aws configure

but after that it is straightforward.但在那之后就很简单了。 For more:更多信息:

aws cognito-idp admin-update-user-attributes help

The OP asked how to change user attributes in Cognito. OP 询问如何在 Cognito 中更改用户属性。 While the primary User Attributes and the custom attributes, can he viewed in the console, they cannot be changed there.而主要用户属性和自定义属性,可以在控制台中查看,但不能在那里更改。
Here is a link to the Python API to access User properties: link .这是访问用户属性的 Python API 链接link The update_user_attributes() method may be what you are looking for. update_user_attributes()方法可能是您正在寻找的方法。

A broader set of APIs for cognito can be found here .可以在此处找到一组更广泛的 Cognito API。

The new Cognito console interface is able to edit now.新的 Cognito 控制台界面现在可以进行编辑。

From console go to Amazon Cognito > User pools > {the user pool you want to select} > {user you want to edit}从控制台转到 Amazon Cognito > 用户池 > {您要选择的用户池} > {您要编辑的用户}

Under "User attributes" card, click "Edit" on the right在“用户属性”卡下,单击右侧的“编辑” 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM