IDP 初始化 SSO,没有 PrivateKey 密码时如何配置

IDP Initialized SSO, how to configure when dont have the pwd for PrivateKey

我正在使用 spring-security saml 扩展来为我的应用程序实施 IDP 发起的 SSO。我正在使用 https 协议并且 signature/encryption 处于打开状态。我不需要 SLO/SP-Initiated SSO。

在传输层的 encryption/decryption(因为使用 HTTPS 协议),我很好,因为我的 Web 容器(SP 一个)将负责解密部分。并且此证书可能与 SP 的证书不同。

在 SP 端,我需要 IDP 的 public 密钥来验证 SAMLAuthResponse Msg 上的签名,我将其作为 IDP 元数据文件的一部分...所以这里没有问题。

几个问题:

  1. 要解密 SAMLAuthResponse Msg,我需要 SP 吗 证书的私钥?
  2. 如果我需要私钥,如何 当我有 jks 文件时,为 keyManager 创建 bean 定义, jks-pwd,别名,但没有私钥的密码?我可以在别名-密码值对的密码字段中传递空字符串(如“”)吗?

在这种情况下您可以跳过私钥的使用。您可以在 manual chapter 8.1:

中找到有关如何在没有密钥库的情况下使用 Spring SAML 的详细信息

In case your application doesn't need to create digital signatures and/or decrypt incoming messages, it is possible to use an empty implementation of the keystore which doesn't require any JKS file - org.springframework.security.saml.key.EmptyKeyManager. This can be the case for example when using only IDP-Initialized single sign-on. Please note that when using the EmptyKeyManager some of Spring SAML features will be unavailable. This includes at least SP-initialized Single Sign-on, Single Logout, usage of additional keys in ExtendedMetadata and verification of metadata signatures. Use the following bean in order to initialize the EmptyKeyManager:

<bean id="keyManager" class="org.springframework.security.saml.key.EmptyKeyManager"/>