mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
Dynamically load MacOS passkey (#12897)
This commit is contained in:
@@ -30,6 +30,7 @@ void runSync(void* context, NSDictionary *params) {
|
|||||||
[mappedCredentials addObject:credential];
|
[mappedCredentials addObject:credential];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (@available(macos 14, *)) {
|
||||||
if ([type isEqualToString:@"fido2"]) {
|
if ([type isEqualToString:@"fido2"]) {
|
||||||
NSString *cipherId = credential[@"cipherId"];
|
NSString *cipherId = credential[@"cipherId"];
|
||||||
NSString *rpId = credential[@"rpId"];
|
NSString *rpId = credential[@"rpId"];
|
||||||
@@ -37,7 +38,8 @@ void runSync(void* context, NSDictionary *params) {
|
|||||||
NSData *credentialId = decodeBase64URL(credential[@"credentialId"]);
|
NSData *credentialId = decodeBase64URL(credential[@"credentialId"]);
|
||||||
NSData *userHandle = decodeBase64URL(credential[@"userHandle"]);
|
NSData *userHandle = decodeBase64URL(credential[@"userHandle"]);
|
||||||
|
|
||||||
ASPasskeyCredentialIdentity *credential = [[ASPasskeyCredentialIdentity alloc]
|
Class passkeyCredentialIdentityClass = NSClassFromString(@"ASPasskeyCredentialIdentity");
|
||||||
|
id credential = [[passkeyCredentialIdentityClass alloc]
|
||||||
initWithRelyingPartyIdentifier:rpId
|
initWithRelyingPartyIdentifier:rpId
|
||||||
userName:userName
|
userName:userName
|
||||||
credentialID:credentialId
|
credentialID:credentialId
|
||||||
@@ -47,6 +49,7 @@ void runSync(void* context, NSDictionary *params) {
|
|||||||
[mappedCredentials addObject:credential];
|
[mappedCredentials addObject:credential];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[ASCredentialIdentityStore.sharedStore replaceCredentialIdentityEntries:mappedCredentials
|
[ASCredentialIdentityStore.sharedStore replaceCredentialIdentityEntries:mappedCredentials
|
||||||
completion:^(__attribute__((unused)) BOOL success, NSError * _Nullable error) {
|
completion:^(__attribute__((unused)) BOOL success, NSError * _Nullable error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user