Skip to content

Commit

Permalink
Applied modification to the original plugin to prevent auto-login iss…
Browse files Browse the repository at this point in the history
…ues with iOS
  • Loading branch information
Alessandro Basso authored and Alessandro Basso committed Mar 16, 2020
1 parent 496efa0 commit a37d303
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ModificationToPlugin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
File: SecureKeyStore.m
Function: writeToSecureKeyStore
After initializing a KeychainItemWrapper called keychain, we added:

KeychainItemWrapper * keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"cordova.plugins.SecureKeyStore" accessGroup:nil];

// Modification to the plugin to prevent autologin issue with iOS
[keychain setObject:(id)kSecAttrAccessibleAfterFirstUnlock forKey:(id)kSecAttrAccessible];
// End modification

NSString *error;

This line sets the keychain access and helped to fix a log out issue affecting certain users.
5 changes: 5 additions & 0 deletions src/ios/SecureKeyStore.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ - (void) writeToSecureKeyStore:(NSMutableDictionary*) dict
{
// get keychain
KeychainItemWrapper * keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"cordova.plugins.SecureKeyStore" accessGroup:nil];

// Modification to the plugin to prevent autologin issue with iOS
[keychain setObject:(id)kSecAttrAccessibleAfterFirstUnlock forKey:(id)kSecAttrAccessible];
// End modification

NSString *error;
// Serialize dictionary and store in keychain
NSData *serializedDict = [NSPropertyListSerialization dataFromPropertyList:dict format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];
Expand Down

0 comments on commit a37d303

Please sign in to comment.