Issues while integrating ADFS with Spring SAML Extension

一笑奈何 提交于 2019-11-27 23:58:14

The exception from ADFS complains that the SAML message was not signed with RSA-SHA256 which it expects, but with RSA-SHA1.

Make sure to set signing algorithm of the Spring SAML's Relaying Party in ADFS to SHA-1. You can find details in the last bullet point of http://docs.spring.io/autorepo/docs/spring-security-saml/1.0.x-SNAPSHOT/reference/htmlsingle/#chapter-idp-guide-adfs-sp

Value="urn:oasis:names:tc:SAML:2.0:status:Responder"

See SAML core specification. It says:

urn:oasis:names:tc:SAML:2.0:status:Responder The request could not be performed due to an error on the part of the SAML responder or SAML authority.

i.e. The ADFS server had trouble interpreting or answering the request. The IdP should tell you what the problem is.

Spring Security SAML extension does not support SHA-256 by defualt. You can extend the org.springframework.security.saml.SAMLBootstrap class to provide the SHA-256.

Override the postProcessBeanFactory method

public class Bootstrap extends SAMLBootstrap {

    @Override
    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);
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!