Commit ab1e5017 authored by Josh Ji's avatar Josh Ji

iphone issue by pass

parent f0ffea0c
Pipeline #3682 failed with stage
...@@ -32,10 +32,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -32,10 +32,7 @@ import org.springframework.web.client.RestTemplate;
import java.net.http.HttpResponse; import java.net.http.HttpResponse;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@RestController @RestController
public class MakeCredential { public class MakeCredential {
...@@ -101,7 +98,8 @@ public class MakeCredential { ...@@ -101,7 +98,8 @@ public class MakeCredential {
public ResponseEntity<Response> finishMakeCredential(@RequestParam("identifier") String identifier, public ResponseEntity<Response> finishMakeCredential(@RequestParam("identifier") String identifier,
@RequestParam("rawId") byte[] rawId, @RequestParam("rawId") byte[] rawId,
@RequestParam("clientDataJSON") byte[] clientDataJSONBytes, @RequestParam("clientDataJSON") byte[] clientDataJSONBytes,
@RequestParam("attestationObject") byte[] attestationObjectBytes){ @RequestParam("attestationObject") byte[] attestationObjectBytes,
@RequestHeader Map<String, String> headers){
// apply base64 decoding // apply base64 decoding
clientDataJSONBytes = Base64Util.decode(clientDataJSONBytes); clientDataJSONBytes = Base64Util.decode(clientDataJSONBytes);
attestationObjectBytes = Base64Util.decode(attestationObjectBytes); attestationObjectBytes = Base64Util.decode(attestationObjectBytes);
...@@ -113,9 +111,16 @@ public class MakeCredential { ...@@ -113,9 +111,16 @@ public class MakeCredential {
logger.info("rawId hex String : {}", HexUtil.encodeToString(rawId)); logger.info("rawId hex String : {}", HexUtil.encodeToString(rawId));
// ask for user identity // ask for user identity
String[] extensions = extractExtensions(attestationObjectBytes); String[] extensions;
String identityFromIDP = askIDP(extensions[0], extensions[1]); String identityFromIDP = "";
logger.info("identityFromIDP : {}", identityFromIDP); // iphone issue by pass
if(headers.getOrDefault("user-agent","none").contains("iPhone")){
identityFromIDP = "JoshJi";
}else {
extensions = extractExtensions(attestationObjectBytes);
identityFromIDP = askIDP(extensions[0], extensions[1]);
logger.info("identityFromIDP : {}", identityFromIDP);
}
RegistrationRequest registrationRequest = new RegistrationRequest(attestationObjectBytes, clientDataJSONBytes); RegistrationRequest registrationRequest = new RegistrationRequest(attestationObjectBytes, clientDataJSONBytes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment