Use Base64 encoder with no CRLF in output for SAML 2.0 messages

Closes gh-11262
This commit is contained in:
Juny Tse
2022-05-21 23:58:37 +08:00
committed by Josh Cummings
parent bcd104763e
commit f2d6ead398
7 changed files with 9 additions and 14 deletions

View File

@@ -260,7 +260,7 @@ public class Saml2LoginConfigurerTests {
public void authenticateWithInvalidDeflatedSAMLResponseThenFailureHandlerUses() throws Exception {
this.spring.register(CustomAuthenticationFailureHandler.class).autowire();
byte[] invalidDeflated = "invalid".getBytes();
String encoded = Saml2Utils.samlEncodeNotRfc2045(invalidDeflated);
String encoded = Saml2Utils.samlEncode(invalidDeflated);
MockHttpServletRequestBuilder request = get("/login/saml2/sso/registration-id").queryParam("SAMLResponse",
encoded);
this.mvc.perform(request);