gpt4 book ai didi

amazon-web-services - AWS Cognito - createIdentityPool - 从哪里获取 ProviderName 和 ClientId?

转载 作者:行者123 更新时间:2023-12-04 13:04:03 24 4
gpt4 key购买 nike

我正在尝试使用 AWS Cognito 来帮助支持我的应用程序中的 Multi-Tenancy 。

https://aws.amazon.com/blogs/apn/managing-saas-users-with-amazon-cognito/

Provisioning User Pools

Assuming you were to associate a single user pool with each tenant, you would need to introduce provisioning automation that would create a tenant’s user pool during the sign-up process. This would also require automation that configures all the other moving parts of Amazon Cognito to declare and associate the user pools with the other Amazon Cognito constructs and security policies.

The basic steps here would be to first create a user pool for the tenant and apply any tenant-specific customizations or policies (these would typically be the same for all tenants). Then, you’d need your automation to provision and configure an identity pool. Finally, you’d have to associate the identity pool with your newly created user pool. The process is a bit more involved than that, but these are the key concepts you need to have in mind as you think about how to add this automation to your tenant creation lifecycle.

AWS provides a series of APIs that you can use to implement your provisioning automation model. These APIs are available for a number of different languages and environments.



到目前为止,我已经能够使用 SDK 来创建许多零碎的东西,但是我正在努力使用 createIdentityPool (),特别是 CognitoIdentityProviders文档指出 CognitoIdentityProviders 应该包含...

ProviderName — (String) The provider name for an Amazon Cognito Identity User Pool. For example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789.

ClientId — (String) The client ID for the Amazon Cognito Identity User Pool.

ServerSideTokenCheck — (Boolean) TRUE if server-side token validation is enabled for the identity provider’s token.



我应该从哪里获得 ProviderNameClientId

我有变量保存从 createUserPool()createUserPoolClient() 返回的值,但在其中看不到任何适合的内容。

任何帮助表示赞赏。

最佳答案

ClientId 只是您客户端的唯一标识符。
ProviderName 是上述格式的常量字符串,只需在适当的地方插入区域和用户池 ID。

最简单的方法是通过 Cognito 联合身份控制台。它只接收用户池 ID 和客户端 ID,您可以在 Cognito 用户池控制台中创建它们。

如果必须从 SDK 创建身份池,您只需从 Cognito 用户池控制台获取这些值。只需查找有问题的池和客户端。

如果无法使用控制台,您可以调用 ListUserPools 和 ListUserPoolClients 来获取正确的 id。

关于amazon-web-services - AWS Cognito - createIdentityPool - 从哪里获取 ProviderName 和 ClientId?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44003195/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com