aws-amplify / amplify-ui-swift-liveness

This repository offers a UI component for Amazon Rekognition Face Liveness, enabling developers to ensure that only authentic users, and not bad actors using spoofs, can access their services.
https://ui.docs.amplify.aws/swift/connected-components/liveness
Apache License 2.0
9 stars 20 forks source link

Unable to invoke face liveness view #143

Closed LiangLuDev closed 2 months ago

LiangLuDev commented 4 months ago

Describe the bug

Feedback from several users indicates that when attempting to open the facial verification page, a blank page is displayed. I have not been able to replicate this issue myself, and there are no error logs, so I am unsure how to troubleshoot this error. I need assistance in troubleshooting.

This issue occurs sporadically; most users can use the feature normally, but a small number of users are unable to use it. Attached are videos showing the feature being used normally (by me) and the issue where it cannot be used, along with screenshots of the code.

https://github.com/aws-amplify/amplify-ui-swift-liveness/assets/16227011/10728adb-3e56-484e-bc5c-952f037e50ba

https://github.com/aws-amplify/amplify-ui-swift-liveness/assets/16227011/1fc8ecdd-ca4f-421f-a1f6-595019a4530e

Longshot-20240510101519 Longshot-20240510101356 Longshot-20240510102316

Steps To Reproduce

auth is ok
face liveness error

Expected behavior

I want to be able to use the face verification function normally

Swift Liveness Version

1.2.5

Xcode version

15.3

Relevant log output

<details>
<summary>Log Messages</summary>

INSERT LOG MESSAGES HERE



### Is this a regression?

Yes

### Regression additional context

_No response_

### OS Version

iOS 17.1.1(user) 17.4.1(me)

### Device

iPhone 14(user)iPhone 12(me)

### Specific to simulators

_No response_

### Additional context

_No response_
harsh62 commented 4 months ago

Thanks for raising the issue. Our team will look into the issue and provide an update.

phantumcode commented 4 months ago

@LiangLuDev I have not been able to reproduce this issue. It looks like there's been several bug fixes releases from the current version you're using. Are you able to update to the latest released version and see if issue still exists?

Are you able to add additional logging to see if an error code or exception is returned from the component? Are you observing this issue on any specific iOS version or device?

LiangLuDev commented 4 months ago

I have already added logs to the location where results can be obtained, but there is no error information on our analytics platform. From the feedback, it seems that the issue is not related to the iOS version, as the errors occurred on different iOS versions. I will first update the Amplify-related versions and see how it progresses.

LiangLuDev commented 4 months ago

@phantumcode I have upgraded the package to the latest version, but git status does not show any changes. How can I confirm that I have upgraded to the latest version?

Longshot-20240511152211

phantumcode commented 4 months ago

@LiangLuDev Yess, version 1.2.13 is the latest version.

LiangLuDev commented 4 months ago

Hi @phantumcode . I would like to inquire whether there are any restrictions related to facial recognition authentication for user accounts. According to the data I reviewed, our facial recognition feature has been live for approximately two months. However, we have recently received increased feedback about users being unable to invoke the facial recognition page in the past two weeks, despite there being no modifications made or new versions released during this period. I am unsure where to submit a ticket to track and address this issue.

phantumcode commented 4 months ago

@LiangLuDev Can you clarify what you mean by "restrictions related to facial recognition authentication for user accounts"? Your authentication and user accounts are up to you to setup and maintain. Your backend service to create the session id and get the result are up to you to setup and maintain.

Also, please clarify and be more specific on what you mean "unable to invoke the facial recognition page in the past two weeks". Are the users unable to create a session id? Are the users unable to get the result? Are the users able to get a session id and start a liveness session and unable to complete the liveness check? If so, what is the exception or error message you're seeing or capturing? Do you have example of sessions that are running into this issue? If so can you provide the session ids that the service team can look into? Are this issues occurring on a specific platform (iOS/Android/Web) or specific region?

LiangLuDev commented 4 months ago

Currently, this issue is only occurring on the iOS platform. Based on all the logs and screen recording analysis available to us, user login sessions are successful. The redirection to the facial recognition page occurs only after the user successfully creates a session. This can be observed from the code screenshot provided earlier. I will share the session ID with you tomorrow.

As stated above, I am unable to reproduce this issue myself. This feedback was given to me by a user.

LiangLuDev commented 4 months ago

When I call Amplify.configure(), an error occurs, but the facial recognition page can still be invoked normally. Will this have any impact? I noticed that your demo is also written this way.

Unable to configure Amplify PluginError: Could not cast incoming configuration to JSONValue Recovery suggestion: The specified configuration is either nil, or not convertible to a JSONValue. Review the configuration and ensure it contains the expected values, and does not use any types that aren't convertible to a corresponding JSONValue:nil

phantumcode commented 4 months ago

The demo requires Amplify Auth and Amplify API configured to run properly, see the README.md

failure at Amplify.configure is due to your amplifyconfiguration.json being incorrect. If you're using Amplify Auth to provide user authentication, then this would have an impact. Please share the code snippet where you configure Amplify and your amplifyconfiguration.json file with any sensitive information removed/redacted.

LiangLuDev commented 4 months ago

@phantumcode this is my json file The initConfig function is called during application startup.

image Longshot-20240514111212 amplifyconfiguration.json

phantumcode commented 4 months ago

@LiangLuDev It looks like the amplifyconfiguration.json is missing configuration for Amplify API but in your startup you're configuring the Amplify API with the line try Amplify.add(plugin: AWSAPIPlugin())

LiangLuDev commented 4 months ago

@phantumcode I would like to ask about the role of the AWSAPIPlugin. I noticed that it is added in the demo, but I am unsure if we need to utilize it since the application still runs normally even after I commented out "try Amplify.add(plugin: AWSAPIPlugin())".

phantumcode commented 4 months ago

@LiangLuDev The API Plugin is used to make REST calls to create the session id and get the result. If you are using other methods to call your backend to get the session id and result, then it is not needed and you can remove that line of code in the startup configuration.

LiangLuDev commented 4 months ago

@LiangLuDev Can you clarify what you mean by "restrictions related to facial recognition authentication for user accounts"? Your authentication and user accounts are up to you to setup and maintain. Your backend service to create the session id and get the result are up to you to setup and maintain.

Also, please clarify and be more specific on what you mean "unable to invoke the facial recognition page in the past two weeks". Are the users unable to create a session id? Are the users unable to get the result? Are the users able to get a session id and start a liveness session and unable to complete the liveness check? If so, what is the exception or error message you're seeing or capturing? Do you have example of sessions that are running into this issue? If so can you provide the session ids that the service team can look into? Are this issues occurring on a specific platform (iOS/Android/Web) or specific region?

Hi, @phantumcode This is session id for user, I will help investigate. Thank you very much. Since the user has tried multiple times, there will be multiple session IDs.

7d631d5c-530b-484e-a192-3e6438346ade
a05e30e6-409e-477d-acdf-fb682579acfb
37620b49-2397-4299-a9e3-9ad886638c68
802b6d0b-49f4-4084-a55a-e5832e43c17f
ad4b2004-a9af-4c76-a7eb-230eaa9b20da
b89cb244-90fc-47f9-a42d-6b25e3e6ca5c
98027b29-8824-445f-9031-fa53afb03219
phantumcode commented 4 months ago

@LiangLuDev Can you provide what region and approximate timeframe these sessions are for? The service team is not finding them in us-east-1 for the last 4 weeks.

LiangLuDev commented 4 months ago

@LiangLuDev Can you provide what region and approximate timeframe these sessions are for? The service team is not finding them in us-east-1 for the last 4 weeks.

This happened the 2024-05-13

LiangLuDev commented 4 months ago

@LiangLuDev Can you provide what region and approximate timeframe these sessions are for? The service team is not finding them in us-east-1 for the last 4 weeks.

Please help check if there is an issue on our server side when creating sessions. We are using the Go language SDK function CreateFaceLivenessSession. The time frame is approximately [2024-05-13T04:59:56.967212753Z] - [2024-05-13T06:07:04.805981851Z]

phantumcode commented 4 months ago

@LiangLuDev What region is it deployed to? us-east-1?

LiangLuDev commented 4 months ago

@LiangLuDev What region is it deployed to? us-east-1?

Yep.

phantumcode commented 4 months ago

@LiangLuDev We were able to see those sessions get created in us-east-1 but don't see any logs for starting the sessions. It is likely an issue on the client side before any connection is not established to start the liveness check.

Are you able to release and observe if issue still occurs after updating to the latest version of library or capture additional logs/exceptions?

LiangLuDev commented 4 months ago

Okay, we are planning to release a new version by the end of the month.

LiangLuDev commented 4 months ago

@phantumcode Hi, I have already upgraded to the latest version, but the issue with the white screen still occurs as mentioned above. Please assist me in troubleshooting. Otherwise, the boss said we might need to consider an alternative solution.

this is sessionId: efbc1261-1b40-489a-b10c-d3cba8ecde77

phantumcode commented 3 months ago

@LiangLuDev Are you able to provide a sample app that demonstrates how you've integrated Liveness component? I understand that you've provided code snippet in the issue, but it would be helpful to have a sample app to help debug the issue and get more context on how you getting the session id and constructing the view.

LiangLuDev commented 3 months ago

@LiangLuDev Are you able to provide a sample app that demonstrates how you've integrated Liveness component? I understand that you've provided code snippet in the issue, but it would be helpful to have a sample app to help debug the issue and get more context on how you getting the session id and constructing the view.

Of course, I will try to provide an sample app following my project structure as much as possible tomorrow.

ruisebas commented 2 months ago

@LiangLuDev following up on this. Are you still facing this issue? If so, were you able to create the sample app?

Thanks!

LiangLuDev commented 2 months ago

I'm sorry, my local environment is quite complex, and restoring an example program might take too much time. I have already switched to a different solution. Thank you for following up.

github-actions[bot] commented 2 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.