【问题标题】:How to sign AuthnRequest using Apache mod_mellon module如何使用 Apache mod_mellon 模块签署 AuthnRequest
【发布时间】:2019-06-27 14:45:54
【问题描述】:

我们需要在发送到 IDP 之前签署 SAML AuthnRequest。我们正在使用 Apache 模块 mod_mellon 进行 SAML 实施。根据文档,我们在 SP 元数据 xml 文件中添加了以下属性,但仍然没有对请求进行签名。

AuthnRequestsSigned="true"

以下 SP 元数据供参考。

<EntityDescriptor entityID="https://foo.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
  <SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
    <KeyDescriptor use="signing">
      <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:X509Data>
          <ds:X509Certificate>MIIC.....</ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
    </KeyDescriptor>
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://foo.com/mellon/logout"/>
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://foo.com/mellon/postResponse" index="0"/>
</SPSSODescriptor>
</EntityDescriptor>

当我们访问应用程序时,请求仍未签名。如果遇到类似问题,有人可以帮忙吗?

谢谢

【问题讨论】:

    标签: apache saml


    【解决方案1】:

    签名是使用私钥而不是公钥创建的。

    此处不使用 SP 元数据。

    你需要在mellon配置中定义私钥

    例如

    MellonSPPrivateKeyFile /etc/apache2/mellon/ssotest.key
    

    请看https://github.com/UNINETT/mod_auth_mellon

    【讨论】:

    • 嗨,我已经在 mellon.conf 文件中定义了私钥。它正在由apache加载。需要有效用户 AuthType "Mellon" MellonEnable "auth" MellonVariable "cookie" MellonSPMetadataFile /opt/httpd/conf.d/sp-metadata.xml MellonSPPrivateKeyFile /opt/httpd/conf/server.key MellonSPCertFile /opt/jboss/httpd/ conf/server.crt MellonIdPMetadataFile /opt/jboss/httpd/conf.d/idp-metadata.xml
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-15
    • 2013-02-21
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    • 2018-06-23
    相关资源
    最近更新 更多