Repository navigation
Description
Logging into the Tuta Mail app with a USB security key (YubiKey 5) never completes. The key is detected, the assertion succeeds, but the result never reaches the website and the app stays on the login screen.
Versions:
- microG GmsCore 0.3.18.252432 (system app)
- Chrome 157.0.8103.50
- Tuta 366.261105.0
- LineageOS 24.0 (Android 17), Galaxy Tab S7 FE
Steps:
- Tuta app, enter credentials, second factor "security key"
- Tuta opens https://app.tuta.com/webauthnmobile in a Chrome Custom Tab
- Credential Manager sheet -> other sign-in options -> use another device
- microG FIDO screen, plug in the key, allow USB access, touch the key
- Back in Tuta, still on the login screen
What happens in the log:
Tuta starts the Custom Tab with FLAG_ACTIVITY_NO_HISTORY (flg 0x40000000, Chrome forwards it). microG's AuthenticatorActivity is started in the same task and turns itself opaque, so the Custom Tab below gets stopped, and because of NO_HISTORY it's finished right away. When the assertion comes back 1.5 s later, Chrome has nobody waiting for it anymore.
14:40:23.265 I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=https://app.tuta.com/... flg=0x40000000 cmp=com.android.chrome/com.google.android.apps.chrome.IntentDispatcher (has extras)} ... from uid 10174 (de.tutao.tutanota)
14:40:23.472 I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=https://app.tuta.com/... flg=0x5a080000 cmp=com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity (has extras)} ...
14:40:28.899 I/ActivityTaskManager: START u0 {act=org.microg.gms.fido.AUTHENTICATE pkg=com.google.android.gms cmp=com.google.android.gms/org.microg.gms.fido.core.ui.AuthenticatorActivity (has extras)} ...
14:40:28.946 E/ActivityTaskManager: convertFromTranslucent expects null but is ActivityRecord{... com.google.android.gms/org.microg.gms.fido.core.ui.AuthenticatorActivity t107}
14:40:28.966 D/FidoUsbHandler: YubiKey FIDO has permission
14:40:29.483 I/wm_finish_activity: [0,115856476,107,com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity,stop-no-history]
14:40:30.987 D/FidoUi: Finish with success response: AuthenticatorAssertionResponse[...]
14:40:31.036 D/PublicKeyProxyActivity: Passkey authentication successful: {...}
14:40:31.065 I/CredentialManager: onFinalResponseReceived from: com.google.android.gms/com.google.android.gms.auth.api.credentials.credman.service.RemoteService
14:40:31.066 E/cr_ChromiumWebauthn: [CredManHelper] No request callback for getCredential request
The Custom Tab is finished 0.6 s after the FIDO screen shows up (stop-no-history), before the key is even touched.
The relevant code is in AuthenticatorActivity.handleRequest(): unless the instant path is taken, it always calls makeOpaque() (setTranslucent(false)) before showing the UI:
GmsCore/play-services-fido/core/src/main/kotlin/org/microg/gms/fido/core/ui/AuthenticatorActivity.kt
Line 186 in 27af2f9
| makeOpaque() |
As far as I can tell the Play Services FIDO UI doesn't cover the activity below completely, so it only gets paused and this doesn't show up there. Any app that opens WebAuthn in a NO_HISTORY Custom Tab should run into the same thing. A website in the normal Chrome UI (e.g. vault.bitwarden.com) works fine with the same key, since the tab isn't finished when it's stopped.
Possible fix: keep the activity translucent (or show the UI as a bottom sheet / dialog) at least for browser requests, so whatever is behind it only gets paused. There's already a FIXME about moving to a bottom sheet next to setAuthenticatorUiBackgroundOpaque().
Activity