Skip to content

Conversation

@JorgeMucientes
Copy link
Contributor

@JorgeMucientes JorgeMucientes commented Dec 23, 2025

Closes WOOMOB-1702

Description

Coming from this P2 were it was surfaced several issues about not supporting basic auth: p91TBi-dC6-p2
This PR addresses a few changes we agreed on prior to implementing basic auth support in the apps:

  • Better tracking to learn the real impact about this. To properly determine how many users are experiencing such issues
  • Better error handling providing users a proper hint of why the app is failing to log in.
  • Adding better console logs so that HE can easily troubleshoot when basic out issues are the cause of users not being able to log in.

Test Steps

Enable basic auth on you test site prior to following the next testing steps. To enable basic auth on any existing Pressable site just navigate to the site > Advanced > Basic Authentication.
Or use this site url to run the tests: https://woocommerce-android-realapi-tests.mystagingwebsite.com/

Test case 1: Site creds with basic auth

  1. Enter a site address with basic auth enabled
  2. In the site credentials screen enter any random credentials
  3. See the basic auth error displayed:
Screenshot 2025-12-23 at 17 16 39
  1. Check the following event is tracked when this happens:
woocommerceandroid_login_site_credentials_login_failed, Properties: {"step":"authentication","network_status_code":"401","error_context":"CookieNonceAuthenticationException","error_type":"BASIC_AUTH_REQUIRED"

Important thing here is the "error_type":"BASIC_AUTH_REQUIRED"

  1. Check the following log is show in the logcat: Authentication failed, error: BASIC_AUTH_REQUIRED,

Test case 2: Log in normally with site credentials
Just test that login with site credentials for any other site were basic auth is not enabled works as expected.

Images/gif

Screen_recording_20251223_164937.mp4
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@JorgeMucientes JorgeMucientes added this to the 23.9 milestone Dec 23, 2025
@JorgeMucientes JorgeMucientes added the feature: login Related to any part of the log in or sign in flow, or authentication. label Dec 23, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 23, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitcdd0544
Direct Downloadwoocommerce-wear-prototype-build-pr15136-cdd0544.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 23, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitcdd0544
Direct Downloadwoocommerce-prototype-build-pr15136-cdd0544.apk

@JorgeMucientes JorgeMucientes marked this pull request as ready for review December 23, 2025 18:04
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.63%. Comparing base (0ed84e3) to head (cdd0544).
⚠️ Report is 17 commits behind head on trunk.

Files with missing lines Patch % Lines
...oocommerce/android/ui/login/WPApiSiteRepository.kt 0.00% 3 Missing ⚠️
...ndroid/fluxc/network/rest/wpapi/NonceRestClient.kt 66.66% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #15136   +/-   ##
=========================================
  Coverage     38.63%   38.63%           
- Complexity    10455    10460    +5     
=========================================
  Files          2179     2179           
  Lines        123919   123928    +9     
  Branches      17094    17095    +1     
=========================================
+ Hits          47877    47882    +5     
- Misses        71221    71223    +2     
- Partials       4821     4823    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@irfano irfano self-assigned this Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: login Related to any part of the log in or sign in flow, or authentication.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants