openmobilehub / android-omh-auth

Apache License 2.0
4 stars 1 forks source link

OMH Auth Android - Issues with Providers on Meta Quest 3 VR (HorizonOS) #85

Open dzuluaga opened 5 months ago

dzuluaga commented 5 months ago

OMH Auth Android is facing issues with certain providers on Meta Quest 3 VR (HorizonOS, Android 12):

  1. Google Auth non-GMS:

    • Timestamp: 0:36
    • Issue: Fails to authenticate. See video.
  2. Facebook:

    • Timestamp: 0:45
    • Issue: Login screen does not load. See video.
  3. Dropbox:

    • Timestamp: 2:46
    • Issue: Authentication fails after credentials are entered. See video.

Successful Provider:

Video Evidence: Link

Possible Causes:

Request:

Thank you for your assistance.

CC - @prestonlau @itsme291

p-syche commented 3 months ago

Hello everyone! Myself and @jbinda had the pleasure of investigating this bug. Here's a summary of our findings:

  1. Bug reproduction - we were able to reproduce the bug on Meta Quest 3 goggles. Setting up the developer environment on the goggles is a considerable effort. We were not able to find a way to set up Meta Quest emulators in the time frame we were given (but it may be possible). Some issues were reproducible on phone emulators that did not have Google Play Services, but the tests yielded somewhat different results from the goggles.
  2. Bug root cause - the different behaviors of different login flows point to a complex root cause:
    • Google -> we were able to determine that Meta Quest goggles do not support CustomTabs (More on CustomTabs: https://developer.chrome.com/docs/android/custom-tabs/howto-custom-tab-check )
    • Facebook -> the same issue as with Google (missing support for CustomTabs is causing the login page to not show. However, when we tested using Brave browser as default, which circumvents the CustomTabs issue, we were still unable to complete the login flow.
    • Microsoft -> works well on all platforms
    • Dropbox -> fails to redirect to the browser; I was unable to pinpoint a specific root cause, but going through Dropbox documentation should be helpful
  3. Potential fixes:
    • we are able to determine if the end user's device supports CustomTabs. In case they do not we can suggest the user downloads an alternative browser. We've had success with Brave
    • we could add logic to verify if there is any browser installed on user device that has support for CustomTabs and pick that one to trigger the flow, otherwise show information that running the flow is not possible because lack of support for CustomTabs.
    • for devices that don't support CustomTabs we could potentially add GeckoView browser to the app, to replace the default implementation. In our tests GeckoView worked well on phone emulators but quit unexpectedly on the Meta Quest goggles, so this would require further investigation (an article on using this solution is here)
    • Dropbox login flow fails on Meta Quest 3 goggles only (it works correctly on phones without Google Play Services), but using Brave did not solve the issue. The issues seems to be closely coupled with the dropbox SDK.
  4. Screenshots: Issue when trying to log in on a device that does not support CustomTabs: image

Successful login with Brave browser on device without CustomTabs: image (1)

Successful login with Brave on Meta Quest 3:

https://github.com/user-attachments/assets/8d229fc7-5578-42a7-b046-0bfebe876e87

Unsuccessful Facebook login with Brave, but facing a new error:

https://github.com/user-attachments/assets/41528830-401c-4d8d-adef-1bb6d3894fd6

dzuluaga commented 3 months ago

Thanks so much, @jbinda and @p-syche for the thorough investigation and detailed findings! This is incredibly helpful, and it's great to have a few potential solutions lined up. We'll definitely keep these options in mind as we explore the next steps. The team has been made aware of the issue and your proposed fixes, and we'll be sure to keep you updated as we decide on the best course of action. Please stay tuned for any further developments!

Best, Diego