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 4caf53e96d
commit d0da160007
7 changed files with 8 additions and 13 deletions

View File

@@ -307,7 +307,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);