idserver.servizicie.interno.gov.it - Login via app option is missing for CIE authentification method on Android
Categories
(Web Compatibility :: Site Reports, defect, P1)
Tracking
(Webcompat Priority:P1, Webcompat Score:9, 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)
|
368.83 KB,
video/mp4
|
Details |
Environment:
Operating system: Android 12
Firefox version: Firefox 149.0.2
Steps to reproduce:
- Navigate to: https://iampe.agenziaentrate.gov.it/sam/UI/Login?realm=/agenziaentrate
- Tap on the "CIE" option
- Tap on the "Entra con CIE" button
- 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
| Reporter | ||
Updated•2 months ago
|
| Reporter | ||
Comment 1•2 months ago
|
||
Comment 2•2 months ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 3•2 months ago
|
||
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.
| Reporter | ||
Comment 4•2 months ago
|
||
I can confirm that disabling intervention 1904952 for idserver.serviziocie.interno.gov.it solves the issue
Updated•2 months ago
|
Comment 5•2 months ago
|
||
Ok, I'm landing a removal for the intervention now in bug 1904952.
Updated•2 months ago
|
Description
•