Skip to content

Commit ae827b6

Browse files
committed
Fix Jackson 3 deserializer for AuthenticationExtensionsClientOutputs
The deserializer is updated to properly ignore unknown extensions. This fix addresses the WebAuthn authentication failure appeared when using FIDO2 security keys on Safari. Closes gh-18643 Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
1 parent 65bf54d commit ae827b6

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

webauthn/src/main/java/org/springframework/security/web/webauthn/jackson/AuthenticationExtensionsClientOutputsDeserializer.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,18 @@ public AuthenticationExtensionsClientOutputs deserialize(JsonParser parser, Dese
5555
throws JacksonException {
5656
List<AuthenticationExtensionsClientOutput<?>> outputs = new ArrayList<>();
5757
for (String key = parser.nextName(); key != null; key = parser.nextName()) {
58-
JsonToken startObject = parser.nextValue();
59-
if (startObject != JsonToken.START_OBJECT) {
60-
break;
61-
}
62-
if (CredentialPropertiesOutput.EXTENSION_ID.equals(key)) {
58+
JsonToken next = parser.nextToken();
59+
if (next == JsonToken.START_OBJECT && CredentialPropertiesOutput.EXTENSION_ID.equals(key)) {
6360
CredentialPropertiesOutput output = parser.readValueAs(CredentialPropertiesOutput.class);
6461
outputs.add(output);
6562
}
6663
else {
6764
if (logger.isDebugEnabled()) {
6865
logger.debug("Skipping unknown extension with id " + key);
6966
}
70-
parser.nextValue();
67+
if (next.isStructStart()) {
68+
parser.skipChildren();
69+
}
7170
}
7271
}
7372

0 commit comments

Comments
 (0)