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 <loeiz.tanguy@gmail.com>
This commit is contained in:
parent
d0db5e3ea3
commit
92048529d2
|
@ -304,7 +304,7 @@ public class Webauthn4JRelyingPartyOperations implements WebAuthnRelyingPartyOpe
|
||||||
|
|
||||||
private com.webauthn4j.data.PublicKeyCredentialParameters convertParamToWebauthn4j(
|
private com.webauthn4j.data.PublicKeyCredentialParameters convertParamToWebauthn4j(
|
||||||
PublicKeyCredentialParameters parameter) {
|
PublicKeyCredentialParameters parameter) {
|
||||||
if (parameter.getType() != PublicKeyCredentialType.PUBLIC_KEY) {
|
if (!PublicKeyCredentialType.PUBLIC_KEY.getValue().equals(parameter.getType().getValue())) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Cannot convert unknown credential type " + parameter.getType() + " to webauthn4j");
|
"Cannot convert unknown credential type " + parameter.getType() + " to webauthn4j");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue