Open Bug 2034810 Opened 2 months ago Updated 2 months ago

idserver.servizicie.interno.gov.it - Login via app option is missing for CIE authentification method on Android

Categories

(Web Compatibility :: Site Reports, defect, P1)

ARM
Android

Tracking

(Webcompat Priority:P1, Webcompat Score:9, firefox150 affected, firefox151 affected, firefox152 affected)

Webcompat Priority P1
Webcompat Score 9
Tracking Status
firefox150 --- affected
firefox151 --- affected
firefox152 --- affected

People

(Reporter: rbucata, Unassigned)

References

()

Details

(Keywords: webcompat:platform-bug, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs][webcompat:sightline])

User Story

user-impact-score:1600
platform:windows,mac,linux,android
impact:workflow-broken
configuration:general
affects:all
branch:release
diagnosis-team:webcompat

Attachments

(1 file)

Environment:
Operating system: Android 12
Firefox version: Firefox 149.0.2

Steps to reproduce:

  1. Navigate to: https://iampe.agenziaentrate.gov.it/sam/UI/Login?realm=/agenziaentrate
  2. Tap on the "CIE" option
  3. Tap on the "Entra con CIE" button
  4. Observe the new page opened

Expected Behavior:
Italian CIE app authentication is present

Actual Behavior:
Italian CIE app authentication is missing

Notes:

  • Reproduces regardless of the status of ETP
  • Reproduces in firefox-nightly, and firefox-release
  • Does not reproduce in chrome

Created from https://github.com/webcompat/web-bugs/issues/216405

Attached video Chr vs ff android

Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.

Whiteboard: [webcompat-source:web-bugs] → [webcompat-source:web-bugs][webcompat:sightline]
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: --- → 1

I did some debugging on the issue, here's what I found:
The site idserver.servizicie.interno.gov.it fails to correctly identify Firefox on Android as a mobile device due to a regular expression check failing in its client-side logic. This prevents the correct execution of mobile-specific features (like CieID app authentication).

Root cause

The website uses a JavaScript function is.mobile() to detect whether it is running on a mobile device. The logic of said function is implemented as follows:

is.mobile = function() {
    return is.iphone() || is.ipod() || is.androidPhone() || is.blackberry() || is.windowsPhone();
};

Specifically, the issue arises because is.androidPhone() incorrectly returns false. It's implementation is as it follows:

is.androidPhone = function() {
    return /android/.test(userAgent) && /mobile/.test(userAgent);
};

where userAgent is evaluated as a navigator.userAgent.toLowerCase().

The issue

The first part of the check correctly returns true. /mobile/.test(userAgent), on the other hand, returns false. This is because, despite the User Agent on my OnePlus AC2003 (Firefox Nightly, Android 12, no extensions, default configuration, no ETP, USB debugging) being something like this:

Mozilla/5.0 (Android 12; Mobile; rv:152.0) Gecko/152.0 Firefox/152.0

the expression (navigator && navigator.userAgent || '').toLowerCase() returns something that looks like:

mozilla/5.0 (linux; android 12; nexus 5 build/mra58n) applewebkit/537.36 (khtml, like gecko) chrome/143.0.0.0 safari/537.36

Thus, not being present the substring mobile, /mobile/.test(userAgent) returns false.

The fix

The problem is likely caused by an outdated WebCompat fix (bug 19204952) on idserver.serviziocie.interno.gov.it that spoofs Firefox's User Agent. By deactivating it via about:compat, the website returns behaving as expected.

Flags: needinfo?(rbucata)

I can confirm that disabling intervention 1904952 for idserver.serviziocie.interno.gov.it solves the issue

Flags: needinfo?(rbucata)
Severity: -- → S2
User Story: (updated)
Webcompat Priority: P3 → P1
Webcompat Score: 1 → 8
Flags: needinfo?(twisniewski)
Priority: -- → P1

Ok, I'm landing a removal for the intervention now in bug 1904952.

Flags: needinfo?(twisniewski)
User Story: (updated)
Webcompat Score: 8 → 9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: