diff --git a/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AssertionSuperGluuController.java b/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AssertionSuperGluuController.java index 9ae37c7d19e..2789134d8aa 100644 --- a/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AssertionSuperGluuController.java +++ b/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AssertionSuperGluuController.java @@ -10,8 +10,11 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; + +import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; + import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -165,7 +168,7 @@ public JsonNode finishAuthentication(String userName, String authenticateRespons throw new Fido2RpRuntimeException("Failed to parse options assertion request", ex); } - if (!authenticateResponse.getClientData().getTyp().equals(RawAuthenticationService.AUTHENTICATE_GET_TYPE)) { + if (!ArrayUtils.contains(RawAuthenticationService.SUPPORTED_AUTHENTICATE_TYPES, authenticateResponse.getClientData().getTyp())) { throw new Fido2RuntimeException("Invalid options attestation request type"); } diff --git a/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AttestationSuperGluuController.java b/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AttestationSuperGluuController.java index 775a7bbf33c..ef5d4d2c2ab 100644 --- a/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AttestationSuperGluuController.java +++ b/jans-fido2/server/src/main/java/io/jans/fido2/service/sg/converter/AttestationSuperGluuController.java @@ -11,6 +11,7 @@ import java.nio.charset.Charset; import java.security.cert.CertificateEncodingException; +import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; import com.fasterxml.jackson.databind.JsonNode; @@ -194,7 +195,7 @@ public JsonNode finishRegistration(String userName, String registerResponseStrin throw new Fido2RpRuntimeException("Failed to parse options attestation request", ex); } - if (!registerResponse.getClientData().getTyp().equals(RawRegistrationService.REGISTER_FINISH_TYPE)) { + if (!ArrayUtils.contains(RawRegistrationService.SUPPORTED_REGISTER_TYPES, registerResponse.getClientData().getTyp())) { throw new Fido2RuntimeException("Invalid options attestation request type"); }