我正在使用Google作为AWS Cognito中的联合身份。
我已经创建了用户,但是我无法在用户池中添加自定义属性。我正在尝试使用控制台添加自定义属性。
当我单击User and Groups
->任何用户时,都看不到此自定义属性。
我还尝试过使用cognito池作为Idp(与Google一起使用),但这也没有任何改变。
我也尝试过使用以下方法创建用户:
aws cognito-idp admin-create-user \
--profile stage \
--region ap-south-1 \
--user-pool-id SSO-Test-User-Pool \
--username [email protected] \
--user-attributes Name=email,[email protected] Name=custom:custom:role,Value="cms.tv_admin" \
--message-action SUPPRESS
但是它给出了错误:
An error occurred (InvalidParameterException) when calling the AdminCreateUser operation: 1 validation error detected: Value 'SSO-Test-User-Pool' at 'userPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+_[0-9a-zA-Z]+
同样,当我尝试使用此方法更新属性时:
aws cognito-idp admin-update-user-attributes \
--profile stage \
--region ap-south-1 \
--user-pool-id SSO-Test-User-Pool \
--username Google_113423776936123400493 \
--user-attributes Name=custom:custom:role,Value=admin
此外,我发现这些命令可以使用该应用程序运行,并且它们需要在登录后返回代码,我想它们将通过重定向URI获得。
如何从CLI使用它?
我在的应用程序的custom属性中设置了可读和可写属性App Client Settings
。
谢谢。
让我知道是否需要更多信息。
这是您的联合池名称,而不是联合池ID。
您可以通过以下方法获取联邦池ID:
从控制台中选择您的身份池,在上面页面的顶部Pool ARN
将是Pool Id
。它将以在其中创建池的区域为前缀。
或者,运行list-identity-pools,然后从Id
属性中复制值。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句