Commit a232b77
authored
Fixing error in construction of LegacyFido2ApiManager (#2654)
### Summary
While testing for their passkey enablement rollout, the Office team
found a bug where if they're using OneAuth with fragment or dialog mode
(and thus using their own Activity instead of AuthorizationActivity),
they run into a casting exception in the process of creating a
LegacyFido2ApiManager, as we need to pass a WebViewAuthorizationFragment
into the constructor.
The devices which would run into this error would be:
- Running on Android 13
- Non-brokered auth
- Are using OneAuth, and specifically using fragment/dialog mode
- According to OneAuth, this is currently only being used by the Office
team, which is why the other apps which rolled out passkey support have
not run into this issue.
The fix for this is to add explicit type checks before creating the
LegacyFido2ApiManager. Because the legacy FIDO2 API does require a
Fragment which has a particular object instantiated (which I had added
into our WebViewAuthorizationFragment), we can't just pass any fragment
from any activity. This means that for Office's case, for Android 13 and
below devices, they are going to only use CredMan- which is actually a
good thing, since CredMan now has support for security keys for all OS
versions (we originally included the legacy API because this wasn't the
case a while ago).
At some point, it would be best to just remove the legacy API logic, but
that can be done once a larger majority of users are on Android 14+.
- Company Portal on Android 13 or below with security key -> Passed on
real device (thanks to Ben)
- Company Portal on Android 13 or below without passkey -> passed on
emulator; could still see the passkey dialogs
- Company Portal on Android 14 -> passed
- Office on Android 13 -> (Waiting for response)
- OneAuthTestApp on Android 13 -> (Waiting for response)
- MsalTestApp on Android 13 -> Passed on emulator
- Test basic brokered and nonbrokered scenarios on Android 14 -> Passed
on real device
Noting again that brokered auth scenarios should remain unaffected
because the legacy API path was never hit (the flight has remained off,
and default value is false). The same should be the case for Android
14+.1 parent f47b86d commit a232b77
File tree
4 files changed
+50
-5
lines changed- common/src
- main/java/com/microsoft/identity/common/internal
- fido
- ui/webview
- test/java/com/microsoft/identity/common/internal/ui/webview
4 files changed
+50
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
239 | 242 | | |
240 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
241 | 246 | | |
242 | | - | |
| 247 | + | |
243 | 248 | | |
244 | 249 | | |
245 | 250 | | |
| |||
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
239 | | - | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
243 | 282 | | |
0 commit comments