2

ADFS を IDP として使用する SSO を実装するために、Spring Security saml 拡張機能を使用しています。

私が理解しているように、Spring Security は open saml を使用して、署名アルゴリズムとして SHA1withRSA を使用して SAML リクエストに署名します。

代わりに SHA256withRSA を使用して SAML リクエストに署名するように変更する必要があります。

これはどのように行うことができますか?

これに関する提案をお待ちしております。よろしくお願いします

4

1 に答える 1

5

必ず最新の 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);

    }

}
于 2014-05-17T17:11:14.690 に答える