AWS CloudFormation Cognito身份提供程序(SAML)
创始人
2024-11-14 17:03:35
0

以下是一个使用AWS CloudFormation创建Cognito身份提供程序(SAML)的示例代码:

Resources:
  CognitoIdentityPool:
    Type: AWS::Cognito::IdentityPool
    Properties:
      IdentityPoolName: MyIdentityPool
      AllowUnauthenticatedIdentities: false
      CognitoIdentityProviders:
        - ClientId: !Ref CognitoUserPoolClient
          ProviderName: !Ref CognitoUserPoolProvider

  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: MyUserPool
      Policies:
        PasswordPolicy:
          MinimumLength: 8
      Schema:
        - Name: email
          AttributeDataType: String
          Mutable: false
          Required: true
        - Name: name
          AttributeDataType: String
          Mutable: false
          Required: true
      UsernameAttributes:
        - email
      AutoVerifiedAttributes:
        - email

  CognitoUserPoolClient:
    Type: AWS::Cognito::UserPoolClient
    Properties:
      UserPoolId: !Ref CognitoUserPool
      ClientName: MyUserPoolClient
      GenerateSecret: false

  CognitoUserPoolProvider:
    Type: AWS::Cognito::UserPoolIdentityProvider
    Properties:
      UserPoolId: !Ref CognitoUserPool
      ProviderName: SAML
      ProviderDetails:
        MetadataURL: "https://example.com/metadata.xml"
        MetadataFile: "metadata.xml"
        EntityId: "urn:example:saml:entityid"
        AttributeMapping:
          email: email
          name: name

这个示例代码使用AWS CloudFormation创建了一个包含Cognito身份提供程序(SAML)的Cognito身份池。它还定义了一个用户池(User Pool)和一个用户池客户端(User Pool Client)。

在ProviderDetails部分,你需要提供SAML身份提供程序的元数据URL(Metadata URL),元数据文件(Metadata File),实体ID(Entity ID)以及属性映射(Attribute Mapping)。

请注意,元数据URL和元数据文件是互斥的,只能选择其中一个。

这个示例代码中的URL和实体ID是占位符,请替换为你自己的实际值。

你可以将这个示例代码保存为一个YAML文件,并使用AWS CloudFormation创建堆栈。

相关内容

热门资讯

外挂办法!poker worl... 外挂办法!poker world辅助,werplan外卦神器-一贯真的有辅助方法(哔哩哔哩)1)we...
外挂模板!德州透视是真的假的,... 您好,德州透视是真的假的这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】很多...
外挂窍要!约局吧开挂,德州之星... 外挂窍要!约局吧开挂,德州之星扫描器-一贯一直总是有辅助工具(哔哩哔哩)1、用户打开应用后不用登录就...
外挂讲义!agpoker辅助,... 外挂讲义!agpoker辅助,wepoker透视有吗-切实真的有辅助插件(哔哩哔哩)1、任何wepo...
外挂方案!pokerworld... 外挂方案!pokerworld辅助器,菠萝辅助器免费版的功能介绍-一贯一直总是有辅助技巧(哔哩哔哩)...
外挂大纲!约局吧德州真的有透视... 外挂大纲!约局吧德州真的有透视挂吗,德普之星私人局辅助器-原来有辅助软件(哔哩哔哩)1、约局吧德州真...
外挂绝活!xpoker辅助助手... 外挂绝活!xpoker辅助助手,佛手在线大菠萝智能辅助器-真是是真的有辅助工具(哔哩哔哩);1、每一...
外挂手段!哈糖大菠萝破解器,德... 外挂手段!哈糖大菠萝破解器,德普之星有透视辅助吗-本来有辅助工具(哔哩哔哩)1、金币登录送、破产送、...
外挂法门!智星德州有脚本吗,德... 外挂法门!智星德州有脚本吗,德州透视竞技联盟-好像一直总是有辅助插件(哔哩哔哩)德州透视竞技联盟破解...
外挂攻略!约局吧开挂神器是真的... 外挂攻略!约局吧开挂神器是真的吗,拱趴大菠萝万能挂-切实存在有辅助教程(哔哩哔哩)1、超多福利:超高...