Skip to content

Commit

Permalink
feat: support cancel request (#3733)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Movchan <Yuriy.Movchan@gmail.com>
  • Loading branch information
yuremm and yurem committed Jan 31, 2023
1 parent f342c7e commit 2741e51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit 2741e51

Please sign in to comment.