mirror of
https://github.com/bitwarden/mobile
synced 2025-12-17 16:53:26 +00:00
[PM-7365] Fix UV not being performed on Fido2 credential creation Android (#3171)
* PM-7365 Fix UV not being performed on Fido2 credential creation on Android * PM-7365 Fix PublicKeyCredentialCreationOptions mapping from json on AuthenticatorSelection so mainly userVerification has correct value
This commit is contained in:
committed by
GitHub
parent
c1522e249d
commit
96a7d5e089
@@ -1,4 +1,5 @@
|
|||||||
using Android.App;
|
using System.Text.Json.Nodes;
|
||||||
|
using Android.App;
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
using AndroidX.Credentials;
|
using AndroidX.Credentials;
|
||||||
@@ -57,11 +58,25 @@ namespace Bit.App.Platforms.Android.Autofill
|
|||||||
.Build();
|
.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static PublicKeyCredentialCreationOptions GetPublicKeyCredentialCreationOptionsFromJson(string json)
|
||||||
|
{
|
||||||
|
var request = new PublicKeyCredentialCreationOptions(json);
|
||||||
|
var jsonObj = new JSONObject(json);
|
||||||
|
var authenticatorSelection = jsonObj.GetJSONObject("authenticatorSelection");
|
||||||
|
request.AuthenticatorSelection = new AuthenticatorSelectionCriteria(
|
||||||
|
authenticatorSelection.OptString("authenticatorAttachment", "platform"),
|
||||||
|
authenticatorSelection.OptString("residentKey", null),
|
||||||
|
authenticatorSelection.OptBoolean("requireResidentKey", false),
|
||||||
|
authenticatorSelection.OptString("userVerification", "preferred"));
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
public static async Task CreateCipherPasskeyAsync(ProviderCreateCredentialRequest getRequest, Activity activity)
|
public static async Task CreateCipherPasskeyAsync(ProviderCreateCredentialRequest getRequest, Activity activity)
|
||||||
{
|
{
|
||||||
var callingRequest = getRequest?.CallingRequest as CreatePublicKeyCredentialRequest;
|
var callingRequest = getRequest?.CallingRequest as CreatePublicKeyCredentialRequest;
|
||||||
var origin = callingRequest.Origin;
|
var origin = callingRequest.Origin;
|
||||||
var credentialCreationOptions = new PublicKeyCredentialCreationOptions(callingRequest.RequestJson);
|
var credentialCreationOptions = GetPublicKeyCredentialCreationOptionsFromJson(callingRequest.RequestJson);
|
||||||
|
|
||||||
var rp = new Core.Utilities.Fido2.PublicKeyCredentialRpEntity()
|
var rp = new Core.Utilities.Fido2.PublicKeyCredentialRpEntity()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ namespace Bit.App
|
|||||||
Options.FromFido2Framework = appOptions.FromFido2Framework;
|
Options.FromFido2Framework = appOptions.FromFido2Framework;
|
||||||
Options.Fido2CredentialAction = appOptions.Fido2CredentialAction;
|
Options.Fido2CredentialAction = appOptions.Fido2CredentialAction;
|
||||||
Options.CreateSend = appOptions.CreateSend;
|
Options.CreateSend = appOptions.CreateSend;
|
||||||
|
Options.HasUnlockedInThisTransaction = appOptions.HasUnlockedInThisTransaction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user