Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java spring安全中SAML请求签名算法的改进_Java_Spring_Digital Signature_Saml_Spring Saml - Fatal编程技术网

Java spring安全中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配置中插入它,而不是原来

我正在使用SpringSecuritySAML扩展来实现SSO,其中ADFS作为IDP

据我所知,spring security使用open saml对saml请求进行签名,并使用SHA1 WITHRSA作为签名算法

我们需要更改为使用SHA256withRSA签署SAML请求

如何做到这一点


感谢您对此提出的任何建议。提前非常感谢

请确保使用最新的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可配置吗?有一个全新的实现正在进行中,我不相信新功能将添加到当前版本中。