Skip to content

Commit 4c3c3e6

Browse files
Merge branch '5.8.x' into 6.0.x
Closes gh-13939
2 parents 13a2975 + 64270f2 commit 4c3c3e6

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2LogoutRequestMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ class Saml2LogoutRequestMixin {
5353

5454
@JsonCreator
5555
Saml2LogoutRequestMixin(@JsonProperty("location") String location,
56-
@JsonProperty("relayState") Saml2MessageBinding relayState,
56+
@JsonProperty("binding") Saml2MessageBinding binding,
5757
@JsonProperty("parameters") Map<String, String> parameters, @JsonProperty("id") String id,
5858
@JsonProperty("relyingPartyRegistrationId") String relyingPartyRegistrationId) {
5959
}

saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/jackson2/Saml2LogoutRequestMixinTests.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22+
import com.fasterxml.jackson.core.JsonProcessingException;
23+
import com.fasterxml.jackson.databind.DeserializationFeature;
2224
import com.fasterxml.jackson.databind.ObjectMapper;
2325
import org.junit.jupiter.api.BeforeEach;
2426
import org.junit.jupiter.api.Test;
@@ -52,6 +54,19 @@ void shouldSerialize() throws Exception {
5254

5355
@Test
5456
void shouldDeserialize() throws Exception {
57+
deserializeAndAssertRequest();
58+
}
59+
60+
// gh-12539
61+
@Test
62+
void shouldDeserializeWhenFailOnMissingCreatorPropertiesEnabled() throws Exception {
63+
// Jackson will use reflection to initialize the binding property if this is not
64+
// enabled
65+
this.mapper.configure(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES, true);
66+
deserializeAndAssertRequest();
67+
}
68+
69+
private void deserializeAndAssertRequest() throws JsonProcessingException {
5570
Saml2LogoutRequest logoutRequest = this.mapper.readValue(TestSaml2JsonPayloads.DEFAULT_LOGOUT_REQUEST_JSON,
5671
Saml2LogoutRequest.class);
5772

0 commit comments

Comments
 (0)