diff --git a/webauthn/src/test/java/org/springframework/security/web/webauthn/jackson/JacksonTests.java b/webauthn/src/test/java/org/springframework/security/web/webauthn/jackson/JacksonTests.java index 6c68662e80..1b511da78d 100644 --- a/webauthn/src/test/java/org/springframework/security/web/webauthn/jackson/JacksonTests.java +++ b/webauthn/src/test/java/org/springframework/security/web/webauthn/jackson/JacksonTests.java @@ -121,6 +121,30 @@ class JacksonTests { assertThat(outputs).usingRecursiveComparison().isEqualTo(credProps); } + @Test + void readAuthenticationExtensionsClientOutputsWhenUnknownExtension() { + String json = """ + { + "unknownObject1": { + "key": "value" + }, + "unknownArray": [ + { "key": "value1" }, + { "key": "value2" } + ], + "credProps": { + "rk": false + }, + "unknownObject2": {} + } + """; + CredentialPropertiesOutput credProps = new CredentialPropertiesOutput(false); + + AuthenticationExtensionsClientOutputs outputs = this.mapper.readValue(json, + AuthenticationExtensionsClientOutputs.class); + assertThat(outputs.getOutputs()).usingRecursiveFieldByFieldElementComparator().contains(credProps); + } + @Test void readAuthenticationExtensionsClientOutputsWhenFieldAfter() throws Exception { String json = """