首页 > 解决方案 > 如何在 JSON 中的 AWS CloudFormation 模板中将 google 添加为 AWS cognito 身份提供商

问题描述

我正在使用亚马逊网络服务。在 AWS CloudFormation 中,我在 JSON 中创建了一个模板,我必须在其中添加身份池作为资源,我必须使用 Google 作为 Cognito 身份提供者。如果我们在 CognitoIdentityProvider 中使用 Google,那么对象中的值应该是什么?IE

"CognitoIdentityProvider":[
{
  "ClientId": String,
  "ProviderName": String,
  "ServerSideTokenCheck": Boolean
}
]

如果我们将 Google 用作 CognitoIdentityProvider ,任何人都可以帮助我了解此对象属性的值吗?请帮忙。

标签: amazon-web-servicesamazon-cloudformationamazon-cognito

解决方案


我可以使用 Cloudformation 设置 AWS Cognito 用户池身份提供商相关的位吗?

正如我在那里所说,对我有用的是:

CognitoUserPoolIdentityProvider:
  Type: AWS::Cognito::UserPoolIdentityProvider
  Properties: 
    ProviderName: Google
    AttributeMapping:
      email: emailAddress
    ProviderDetails:
      client_id: <yourclientid>.apps.googleusercontent.com
      client_secret: <yourclientsecret>
      authorize_scopes: email openid
    ProviderType: Google
    UserPoolId: 
      Ref: CognitoUserPool

推荐阅读