liveness-detection-framework icon indicating copy to clipboard operation
liveness-detection-framework copied to clipboard

CORS Issue

Open nemanjamildaon opened this issue 2 years ago • 2 comments

Describe the bug CORS Issue

To Reproduce Open FrontEnd Application Select Nose or Pose Challenge Hit Verify Now

Console log show this error: https://xxxxxxx.execute-api.eu-west-1.amazonaws.com/dev//challenge CORS Missing Allow Origin

Assumption bug: dev//challenge - missing string between slashes

nemanjamildaon avatar Oct 20 '22 15:10 nemanjamildaon

Hi, maybe this can help you. I had issues with the application when using /verify with the nose challenge. To fix it I needed to go to the nose.py file and add the condition for the 'residual' variable:

_, residuals, _, _, _ = np.polyfit(nose_trajectory_x, nose_trajectory_y, 2, full=True)
if not residuals:
    residuals = 0
trajectory_error = math.sqrt(residuals / len(context['nose_trajectory']))

in the nose_state function.

References: 1: https://github.com/aws-samples/liveness-detection/issues/8 2: https://stackoverflow.com/questions/60541185/aws-live-human-detection-from-video

italomf avatar Nov 11 '22 22:11 italomf

Hi

I ran into same issue as well. Double slash URL can be fixed with changing the endpoint variables in source/client/.env file. Original: REACT_APP_API_START_ENDPOINT=/challenge REACT_APP_API_FRAMES_ENDPOINT_PATTERN=/challenge/{challengeId}/frame REACT_APP_API_VERIFY_ENDPOINT_PATTERN=/challenge/{challengeId}/verify Replaced REACT_APP_API_START_ENDPOINT=challenge REACT_APP_API_FRAMES_ENDPOINT_PATTERN=challenge/{challengeId}/frame REACT_APP_API_VERIFY_ENDPOINT_PATTERN=challenge/{challengeId}/verify

But even with these changes, CORS issue still remains. I also enabled CORS on every endpoint on API Gateway. I have also checked Chalice routes and all endpoints have cors=True as parameter.

Any chance on fixing this issue?

talha-ergun avatar Jan 24 '23 12:01 talha-ergun