简体   繁体   English

AWS Cognito:更改用户自定义字段的值

[英]AWS Cognito: Change the value of users' custom field

I'm working on my project and making an android app using Cognito for user management.我正在处理我的项目并使用 Cognito 制作一个用于用户管理的 android 应用程序。

I tried to use it as user database so I made some custom fields like age and picture_url.我尝试将其用作用户数据库,因此我制作了一些自定义字段,如年龄和图片网址。 But I cannot find a way to change the value of a custom field.但是我找不到更改自定义字段值的方法。 I found the code to delete the value of field but couldn't find the one to register to an existing user.我找到了删除字段值的代码,但找不到向现有用户注册的代码。

Is it impossible to change the value of a custom field from android or lambda in python so that I need to switch to RDS to store user information?是否无法在 python 中从 android 或 lambda 更改自定义字段的值,以便我需要切换到 RDS 来存储用户信息?

The Python SDK method which should work for this is CognitoIdentityProvider.Client.update_user_attributes ( Python SDK AWS Docs )应该为此工作的 Python SDK 方法是CognitoIdentityProvider.Client.update_user_attributesPython SDK AWS Docs

For the attribute name be sure to prefix it with custom: ( custom:age and custom:picture_url for the attributes you mentioned).对于属性名称一定要与前缀它custom:custom:agecustom:picture_url的属性你提到)。 The custom prefix is mentioned here: AWS Docs: Configuring User Pool Attributes此处提到了自定义前缀: AWS Docs:配置用户池属性

If you are using Client based access be sure the Client has access to modify the custom attributes.如果您使用基于客户端的访问,请确保客户端有权修改自定义属性。 I don't believe clients which exist prior to the custom attribute being created automatically have access to modify the newly created attribute.我不相信在自动创建自定义属性之前存在的客户端有权修改新创建的属性。

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

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