Skip to content

Commit 9204852

Browse files
authored
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 d0db5e3 commit 9204852

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
@@ -304,7 +304,7 @@ private List<com.webauthn4j.data.PublicKeyCredentialParameters> convertCredentia
304304

305305
private com.webauthn4j.data.PublicKeyCredentialParameters convertParamToWebauthn4j(
306306
PublicKeyCredentialParameters parameter) {
307-
if (parameter.getType() != PublicKeyCredentialType.PUBLIC_KEY) {
307+
if (!PublicKeyCredentialType.PUBLIC_KEY.getValue().equals(parameter.getType().getValue())) {
308308
throw new IllegalArgumentException(
309309
"Cannot convert unknown credential type " + parameter.getType() + " to webauthn4j");
310310
}

0 commit comments

Comments
 (0)