Skip to content

LG-11377 Add Selfie UI Behind Feature Flag#9553

Closed
charleyf wants to merge 7 commits intomainfrom
charley/lg-11377-add-selfie-ui
Closed

LG-11377 Add Selfie UI Behind Feature Flag#9553
charleyf wants to merge 7 commits intomainfrom
charley/lg-11377-add-selfie-ui

Conversation

@charleyf
Copy link
Contributor

@charleyf charleyf commented Nov 6, 2023

🎫 Ticket

https://cm-jira.usa.gov/browse/LG-11377

🛠 Summary of changes

This is PR 3 of 3 that will meet the ACs of LG-11377

  1. #9536 Add the feature flag
  2. #9546 Make AcuantPassiveLiveness available in the FE (loading the script).
  3. #9553 (this PR) Add the selfie UI. See LG-11377 Add Selfie UI #9580

This PR uses the Acuant SDK to capture a selfie on the document upload page in the docauth javascript app. All work in this PR is behind a featureflag. To see it locally set this in application.yml doc_auth_selfie_capture: '{"enabled":true}'

Comment on lines +370 to +374
onCaptured: (base64Image) => {
// Triggered when accept button is tapped
console.log('onCaptured');
//onImageCaptureSuccess({image: base64Image});
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently not being called when I click the accept button.

  • I'm seeing the onDetection, onOpened, and onClosed callbacks being called.
  • I'm getting a console error about a content security policy failure.
  • That console error goes away when I comment out the lines that load the opencv script (in context/acuant)

The mobile setup I use to see these console errors is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite feel stuck yet, but figured I'd ask before that happens. @aduth any thoughts on this?

  • It seems possible that I've missed a step in the directions I'm following here?
  • This callback setup is new since we removed the selfi UI code, so no help there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the content security policy error be the root cause? Could be worth trying to disable that temporarily to see if it behaves any different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It's not immediately clear to me how to (safely) disable the content security policy. I'm working on that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(safely)

I wouldn't worry too much about being safe with it as long as it's just for testing locally.

You could probably gut some parts of config/initializers/content_security_policy.rb or the override_csp_to_allow_acuant in app/controllers/concerns/idv/acuant_concern.rb to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Those code pointers were really helpful. No more content security policy error (for testing).

Turned out not to be the problem, but I think I'm on the right track again. I'm also reassured by the callbacks working correctly in our tiny test app.

const startSelfieCamera = () => {
window.AcuantPassiveLiveness = getActualAcuantPassiveLiveness();
// This opens the native camera, but TODO callbacks
//window.AcuantPassiveLiveness.startManualCapture((image) => console.log('image', image));
Copy link
Contributor Author

@charleyf charleyf Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When uncommented this works fine, logs the image dataurl when you take a picture using the native camera.

@charleyf charleyf mentioned this pull request Nov 13, 2023
4 tasks
@charleyf
Copy link
Contributor Author

This PR was useful in investigating what needs to happen and getting help. The work here is replaced by #9580 .

@charleyf charleyf closed this Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants