Skip to content

Commit f5d714a

Browse files
ltanguyltanguy-s4a
authored andcommitted
Fix credential parameters conversion to WebAuthn4j
Replace comparison with != operator by an .equals() comparison based on text value. The 2 objects have the same value in most setups, but not when used in conjunction with Spring Session for example, as the object in session is built for each request Signed-off-by: ltanguy <[email protected]>
1 parent b0e8730 commit f5d714a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/src/main/java/org/springframework/security/web/webauthn/management/Webauthn4JRelyingPartyOperations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private List<com.webauthn4j.data.PublicKeyCredentialParameters> convertCredentia
290290

291291
private com.webauthn4j.data.PublicKeyCredentialParameters convertParamToWebauthn4j(
292292
PublicKeyCredentialParameters parameter) {
293-
if (parameter.getType() != PublicKeyCredentialType.PUBLIC_KEY) {
293+
if (!PublicKeyCredentialType.PUBLIC_KEY.getValue().equals(parameter.getType().getValue())) {
294294
throw new IllegalArgumentException(
295295
"Cannot convert unknown credential type " + parameter.getType() + " to webauthn4j");
296296
}

0 commit comments

Comments
 (0)