         keychainQuery[kSecClass as String] = kSecClassGenericPassword
         keychainQuery[kSecAttrService as String] = self.serviceIdentifier
         keychainQuery[kSecAttrAccount as String] = key + "_" + tokenType.rawValue
-        keychainQuery[kSecAttrAccessible as String] = kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
+        keychainQuery[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
 
         // Search for the keychain items
         let statusSearch: OSStatus = SecItemCopyMatching(keychainQuery, nil)
-        
+
         // if found update
         if (statusSearch == errSecSuccess) {
             if (dataFromString != nil) {
                 let attributesToUpdate = NSMutableDictionary()
                 attributesToUpdate[kSecValueData as String] = dataFromString!
-                
+
                 let statusUpdate: OSStatus = SecItemUpdate(keychainQuery, attributesToUpdate)
                 if (statusUpdate != errSecSuccess) {
                     print("tokens not updated")

A handy Keychain wrapper. It saves your OAuth2 tokens using WhenPasscodeSet ACL.
*/
public class KeychainWrap {
    
    /**
    The service id. By default set to apple bundle id.
    */
    public var serviceIdentifier: String
    
    /**
    The group id is Keychain access group which is used for sharing keychain content accross multiple apps issued from same developer. By default there is no access group.
    */
    public var groupId: String?
    
    /**
    Initialize KeychainWrapper setting default values.
    
    :param: serviceId unique service, defulated to bundleId
    :param: groupId used for SSO between app issued from same developer certificate.
    */

        self.accessTokenExpirationDate = nil
        self.refreshTokenExpirationDate = nil
    }

    /**
    Initialize TrustedPersistantOAuth2Session using account id. Account id is the service id used for keychain storage.

    :param: accountId uniqueId to identify the oauth2module
    :param: groupId used for SSO between app issued from same developer certificate.
    :param: accessToken optional parameter to initilaize the storage with initial values
