1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-18 01:03:24 +00:00

[PM-6466] Implement passkeys User Verification (#3044)

* PM-6441 Implement passkeys User Verification

* PM-6441 Reorganized UserVerificationMediatorService so everything is not in the same file

* PM-6441 Fix Unit tests

* PM-6441 Refactor UserVerification on Fido2Authenticator and Client services to be of an enum type so we can see which specific preference the RP sent and to be passed into the user verification mediator service to perform the correct flow depending on that. Also updated Unit tests.

* PM-6441 Changed user verification logic a bit so if preference is Preferred and the app has the ability to verify the user then enforce required UV and fix issue on on Discouraged to take into account MP reprompt
This commit is contained in:
Federico Maccaroni
2024-03-06 12:32:39 -03:00
committed by GitHub
parent e41abf5003
commit 4292542155
46 changed files with 1110 additions and 255 deletions

View File

@@ -51,6 +51,7 @@ namespace Bit.iOS.Autofill
Logo.Image = new UIImage(ThemeHelpers.LightTheme ? "logo.png" : "logo_white.png");
View.BackgroundColor = ThemeHelpers.SplashBackgroundColor;
_context = new Context
{
ExtContext = ExtensionContext
@@ -109,6 +110,7 @@ namespace Bit.iOS.Autofill
try
{
InitAppIfNeeded();
_context.VaultUnlockedDuringThisSession = false;
_context.ServiceIdentifiers = serviceIdentifiers;
if (serviceIdentifiers.Length > 0)
{
@@ -153,6 +155,9 @@ namespace Bit.iOS.Autofill
return;
}
_context.VaultUnlockedDuringThisSession = false;
_context.IsExecutingWithoutUserInteraction = true;
try
{
switch (credentialRequest?.Type)
@@ -196,6 +201,8 @@ namespace Bit.iOS.Autofill
return;
}
_context.VaultUnlockedDuringThisSession = false;
try
{
switch (credentialRequest?.Type)
@@ -237,6 +244,7 @@ namespace Bit.iOS.Autofill
{
InitAppIfNeeded();
_context.Configuring = true;
_context.VaultUnlockedDuringThisSession = false;
if (!await IsAuthed())
{
@@ -326,7 +334,7 @@ namespace Bit.iOS.Autofill
{
if (_context?.IsPasskey == true)
{
_context.ConfirmNewCredentialTcs?.TrySetCanceled();
_context.PickCredentialForFido2CreationTcs?.TrySetCanceled();
_context.UnlockVaultTcs?.TrySetCanceled();
}
@@ -395,6 +403,8 @@ namespace Bit.iOS.Autofill
{
try
{
_context.VaultUnlockedDuringThisSession = true;
if (_context.IsCreatingPasskey)
{
_context.UnlockVaultTcs.SetResult(true);