Comments (35)
4 years later and this issue is still occurring for me, exclusively when the app is woken up in the background due to a significant location change.
from uickeychainstore.
I'm getting this same behavior.
from uickeychainstore.
I think this may happens because of iPhone locking. It always auto-locks because of touch-ID enabled. So some keychain items can be unavailable IMHO.
from uickeychainstore.
Could be, looks like its hitting line 153 and returning nil there. SecItemCopyMatching is not returning a success.
from uickeychainstore.
Same error here. Log:
Communications error: <OS_xpc_error: <error: 0x19c8a3a80> { count = 1, contents =
"XPCErrorDescription" => <string: 0x19c8a3e78> { length = 22, contents = "Connection interrupted" }
}>
Error Domain=com.kishikawakatsumi.uickeychainstore Code=-34018 "The operation couldn’t be completed. (com.kishikawakatsumi.uickeychainstore error -34018.)"
from uickeychainstore.
I'm also having an issue with returning nil when coming back to app
from uickeychainstore.
I've solved problem by caching keychain data in property.
@property (nonatomic, strong) NSData *privateKey;
...
- (NSData *)privateKey {
if (_privateKey == nil)
_privateKey = [UICKeychainStore dataForKey:@"mykeytag"];
return _privateKey;
}
from uickeychainstore.
What's weird is, I saw this issue twice within 30 minutes of loading an app with UICKeyChainStore for the first time. The following 24 hours I never could reproduce it a single time.
from uickeychainstore.
Getting the same bug here. Here's how I consistently reproduce it:
- Hit home button to put app into background
- Open up 6-10 other apps to make sure iOS puts it fully in the background
- Open app and quickly call
stringForKey:error:
. Receives error "Error getting keychain value: Security error has occurred."
from uickeychainstore.
please take a look to the UICKeychain documentation.
and search for keywords "Configuration (Accessibility, Sharing, iCould Sync)"
you need to call the [keyChain setAccessibility: ....... ] function.
Cheers 👯
from uickeychainstore.
Same here randomly returning nil with warning "OSStatus error: [-34018] Security error has occurred"
For me this wasn't due to application going to background/foreground, it just happens randomly
Setting accessibility to UICKeyChainStoreAccessibilityWhenUnlocked, and setting a specific service did not fix the issue either
from uickeychainstore.
Having the same issue here, the application goes back from background, and I have the "Security error has occurred" both when trying to set and get a value from the keychain.
from uickeychainstore.
Alright so I made it work on my device. All it took was to set nil to the accessGroup, and rely on the fact that it takes the first group in the entitlement as default group.
I don't know if it's a bug within iOS or a signing issue.
from uickeychainstore.
@jayztemplier how did you set the accessGroup to nil? I am getting the same issue and curretnly it is a read only property. Did you mod the source?
from uickeychainstore.
I can consistently reproduce this too, doing what @briankracoff described. @jayztemplier 's solution unfortunately did not work for me. Version 1 was working fine. Will investegate.
from uickeychainstore.
@jayztemplier same thing
from uickeychainstore.
anyone fix it?
from uickeychainstore.
@dannyjiajia I just tried this because I had a thought last night:
in - (void)applicationDidBecomeActive:(UIApplication *)application
{
[UICKeyChainStore keyChainStoreWithService:NAME_OF_YOUR_SERVICE accessGroup:nil];
}
It seemed to have worked!
Try it out?
from uickeychainstore.
@theprojectabot Your solution unfortunately did not work for me.I cached the value as @k06a
from uickeychainstore.
I am also experiencing this problem already in :
-(void)applicationWillEnterForeground:(UIApplication *)application
{
UICKeyChainStore *keyChainStore = [UICKeyChainStore keyChainStoreWithService:SERVICE accessGroup:nil];
}
I am also getting the error: OSStatus error: [-34018] Security error has occurred.
However, it looks like it only happens when I am debugging the build.
Haven't seen it else - Anyone who can "confirm"?
from uickeychainstore.
@MortenFalcon happens to me too only while debugging, and not always.
from uickeychainstore.
+1 while debugging only
from uickeychainstore.
Why is this happening? Is there any fix?
from uickeychainstore.
Same issue here, only occurs sometimes, but its annoying because I use it to manage the state of the app.
from uickeychainstore.
+1 while debugging it appears. Doesnt affect the app on the store at the moment.
from uickeychainstore.
Is anybody solve this problem ?
from uickeychainstore.
OSStatus error: [-34018] Security error has occurred. this problem occurs sometimes,can anybody help me?
from uickeychainstore.
Just cache this value in property.
from uickeychainstore.
Any solution?
from uickeychainstore.
This is a known apple bug in the keychain that has yet to be fixed https://forums.developer.apple.com/thread/4743
Facebook and others that depend on app switching for oauth are notably affected. https://m.facebook.com/login.php?next=https%3A%2F%2Fdevelopers.facebook.com%2Fbugs%2F136880803313865&refsrc=https%3A%2F%2Fwww.facebook.com%2Flogin.php&_rdr
from uickeychainstore.
@Blahartinger thanks for your helpful links.
from uickeychainstore.
I came across the same issue too.
from uickeychainstore.
Still there :)
from uickeychainstore.
Still there :)
from uickeychainstore.
Seeing this as well. Anyone have a fix?
from uickeychainstore.
Related Issues (20)
- More options available for authenticationPolicy
- How Much Data Can be Saved into the Keychain? HOT 1
- Crash when SecItemCopyMatching HOT 6
- Error 25308 on iOS 11
- Read passwords from the macOS keychain HOT 5
- 1 HOT 1
- Property 'accessibility' not found on object of type 'UICKeyChainStore *'
- compile-time warnings HOT 1
- Error when trying to archive using new build system in Xcode 10 HOT 1
- Inhibit warnings by wrapping versioning parts into availability blocks.
- Add Swift Package Manager support HOT 1
- how do we load all saved accounts for the same service?
- Tryiing compile framework withing static frameworks HOT 2
- Mac Catalyst Support HOT 4
- Support for Swift 5 HOT 2
- SPM Warning
- Consider using .iOS(.v9)
- IOS 15.x HOT 2
- Olasco Gadgets
- It's really easy to use
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uickeychainstore.