amazon-web-services - 如何将 AD FS 组成员资格映射到自定义 AWS Cognito 属性?

标签 amazon-web-services amazon-cognito saml-2.0 adfs3.0

我的 AD FS 服务器上有以下声明:

LDAP 属性:
token 组 - 非限定名称

传出 claim 类型:
团体

在我的 Saml Response 中返回用户所属的组:

    <AttributeStatement>
        <Attribute Name="http://schemas.xmlsoap.org/claims/Group">
            <AttributeValue>Domain Users</AttributeValue>
            <AttributeValue>AWS-Production</AttributeValue>
            <AttributeValue>AWS-Dev</AttributeValue>
        </Attribute>
    </AttributeStatement>

如何将这些组映射到自定义 Cognito 用户池属性?

我尝试使用以下 SAML 属性名称进行映射:
http://schemas.xmlsoap.org/claims/Group

http://schemas.microsoft.com/ws/2008/06/identity/claims/groups

但这些属性不会映射到 Cognito。我已经尝试将我的自定义映射到其他属性,如电子邮件地址,并且已经成功,只是使用我无法成功映射值的组。

附言抱歉,我会发布更详细地记录该过程的照片,但 imgur 在我的工作中被阻止了。

最佳答案

我最近不得不做一个类似的设置,当我将 AD 组映射到 Cognito custom:adgroups 用户池属性时,我的映射工作了。

我的 SAML 响应片段如下所示:

<Attribute Name="https://aws.amazon.com/SAML/Attributes/Role">
    <AttributeValue>DEV-ODATA</AttributeValue>
    <AttributeValue>DEV-INDEX_PRICES</AttributeValue>
    <AttributeValue>DEV-INDEX_DELAYS</AttributeValue>
    <AttributeValue>DEV-WEBSITE_REPORTING</AttributeValue>
    <AttributeValue>DEV-VALIDATION</AttributeValue>
    <AttributeValue>DEV-ADMIN</AttributeValue>
    <AttributeValue>DEV-GUI</AttributeValue>
    <AttributeValue>DEV-FLOWS</AttributeValue>
    <AttributeValue>DEV-LEGAL</AttributeValue>
    <AttributeValue>DEV-IMG</AttributeValue>
    <AttributeValue>DEV-USER</AttributeValue>
</Attribute>

映射很简单
https://aws.amazon.com/SAML/Attributes/Role  ->   custom:adgroups

但是之后出现了另一个问题,当我必须将这些映射到 Cognito 组时,您可能也想这样做,以管理应用程序权限。有关我如何找到解决方法的详细信息,请访问:AWS Cognito - create groups from ADFS

希望这可以帮助。

关于amazon-web-services - 如何将 AD FS 组成员资格映射到自定义 AWS Cognito 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54097122/

相关文章:

ruby-on-rails - 使用 Cognito 和 Devise 对应用程序进行身份验证

javascript - 使用基于 AWS Cognito 和 IAM 角色的 AWS DynamoDB 直接从客户端(Web 应用程序)访问的安全漏洞是什么

spring-security - 配置 saml-sample (SP) 以与 Okta (IdP) 一起使用

ruby-on-rails - 设计 + OmniAuth Saml:ActionController::InvalidAuthenticityToken

amazon-web-services - 发布 .NET Core 中内置的 AWS Lambda 函数时出错

c# - 带有时间戳的范围键。使用 DynamoDB 进行查询和分页

amazon-web-services - 来自 aws cognito 触发 lambda 的自定义错误

node.js - 如何通过 CloudFormation 使用 MongoDB 设置 Parse Server?

aws-lambda - 从 Cognito 用户池中的组中删除用户只有在注销并重新登录后才会生效

rest - REST API的单点登录支持