Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
将 Amazon Cognito 域用于托管 UI
设置客户端应用程序之后,您可以配置注册和登录网页的地址。您可以将托管 Amazon Cognito 域与您自己的域前缀一起使用。
要使用 Amazon Web Services Management Console 添加应用程序客户端和 Amazon Cognito 托管域,请参阅添加应用程序以启用托管 Web UI。
Prerequisites
在开始之前,您需要:
步骤 1:配置托管用户池域
您可以使用 Amazon Web Services Management Console、Amazon CLI 或 API 来配置用户池域。
- Original console
-
配置域
-
登录 Amazon Cognito 控制台。
-
在导航窗格中,选择管理您的用户池,然后选择要编辑的用户池。
-
选择域名选项卡。
-
在前缀域名框中键入要使用的域前缀。
-
选择 Check availability(检查可用性)以确认域前缀可用。
-
选择保存更改。
- New console
-
配置域
-
导航到用户池的 App integration(应用程序集成)选项卡。
-
选择在 Domain(域)旁边的 Actions(操作),然后选择 Create custom domain(创建自定义域)或 Create Cognito domain(创建 Cognito 域)。如果您已配置用户池域,请先选择 Delete Cognito domain(删除 Cognito 域)或 Delete custom domain(删除自定义域),然后再创建新的自定义域。
-
输入可用的域前缀,将其与 Cognito domain(Cognito 域)结合使用。有关设置 Custom domain(自定义域)的信息,请参阅将您自己的域用于托管 UI
-
选择创建。
- CLI/API
-
使用以下命令可以创建域前缀并将其分配到您的用户池。
配置用户池域
-
Amazon CLI: aws cognito-idp
create-user-pool-domain
示例:aws cognito-idp create-user-pool-domain
--user-pool-id
<user_pool_id>
--domain
<domain_name>
-
Amazon API:CreateUserPoolDomain
获取有关域的信息
-
Amazon CLI: aws cognito-idp
describe-user-pool-domain
示例:aws cognito-idp describe-user-pool-domain
--domain
<domain_name>
-
Amazon API:DescribeUserPoolDomain
如需删除域
-
Amazon CLI: aws cognito-idp
delete-user-pool-domain
示例:aws cognito-idp delete-user-pool-domain
--domain
<domain_name>
-
Amazon API:DeleteUserPoolDomain
步骤 2:验证登录页面
您的域显示在 Amazon Cognito 控制台的 Domain name (域名) 页面上。您的应用程序客户端 ID 和回调 URL 将显示在应用程序客户端设置页面上。