Java spring安全中SAML请求签名算法的改进
我正在使用SpringSecuritySAML扩展来实现SSO,其中ADFS作为IDP 据我所知,spring security使用open saml对saml请求进行签名,并使用SHA1 WITHRSA作为签名算法 我们需要更改为使用SHA256withRSA签署SAML请求 如何做到这一点Java spring安全中SAML请求签名算法的改进,java,spring,digital-signature,saml,spring-saml,Java,Spring,Digital Signature,Saml,Spring Saml,我正在使用SpringSecuritySAML扩展来实现SSO,其中ADFS作为IDP 据我所知,spring security使用open saml对saml请求进行签名,并使用SHA1 WITHRSA作为签名算法 我们需要更改为使用SHA256withRSA签署SAML请求 如何做到这一点 感谢您对此提出的任何建议。提前非常感谢请确保使用最新的Spring SAML(或至少将OpenSAML更新为最新版本)。扩展SAMLBootstrap类,如下所示,并在Spring配置中插入它,而不是原来
感谢您对此提出的任何建议。提前非常感谢请确保使用最新的Spring SAML(或至少将OpenSAML更新为最新版本)。扩展SAMLBootstrap类,如下所示,并在Spring配置中插入它,而不是原来的SAMLBootstrap类:
package fi.schafer.saml.custom;
import org.opensaml.Configuration;
import org.opensaml.xml.security.BasicSecurityConfiguration;
import org.opensaml.xml.signature.SignatureConstants;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
public class SAMLBootstrap extends org.springframework.security.saml.SAMLBootstrap {
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
super.postProcessBeanFactory(beanFactory);
BasicSecurityConfiguration config = (BasicSecurityConfiguration) Configuration.getGlobalSecurityConfiguration();
config.registerSignatureAlgorithmURI("RSA", SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);
config.setSignatureReferenceDigestMethod(SignatureConstants.ALGO_ID_DIGEST_SHA256);
}
}
有可能使registerSignatureAlgorithmURI可配置吗?有一个全新的实现正在进行中,我不相信新功能将添加到当前版本中。