SAML Http Request Intercept with Spring Boot

前端 未结 3 970
南笙
南笙 2021-01-12 13:57

In reference to this SO question Add request parameter to SAML request using Spring Security SAML

I am wanting to replace the default HTTPRedirectDeflateBinding bean

3条回答
  •  隐瞒了意图╮
    2021-01-12 14:27

    1.I think you need to use the super method buildRedirectURL and then add stripped or your custom query params, like this:

    @Override
    protected String buildRedirectURL(SAMLMessageContext messagesContext, String endpointURL, String message) throws MessageEncodingException {
        URLBuilder redirectUrlBuilder = new URLBuilder(super.buildRedirectURL(messagesContext, endpointURL, message));
        List> queryParams = redirectUrlBuilder.getQueryParams();
        queryParams.addAll(new URLBuilder(endpointURL).getQueryParams());// add stripped query params
        return redirectUrlBuilder.buildURL();
    }
    

    2.I am not sure if it fine to pass the null to the HTTPRedirectDeflateBinding as decoder. Alternative would suggest to use the default decoder, which accepts ParserPool.

提交回复
热议问题