Giter Club home page Giter Club logo

Comments (35)

RamblinWreck77 avatar RamblinWreck77 commented on June 5, 2024 2

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.

ChristopherCarranza avatar ChristopherCarranza commented on June 5, 2024

I'm getting this same behavior.

from uickeychainstore.

k06a avatar k06a commented on June 5, 2024

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.

ChristopherCarranza avatar ChristopherCarranza commented on June 5, 2024

Could be, looks like its hitting line 153 and returning nil there. SecItemCopyMatching is not returning a success.

from uickeychainstore.

elado avatar elado commented on June 5, 2024

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.

rajohns08 avatar rajohns08 commented on June 5, 2024

I'm also having an issue with returning nil when coming back to app

from uickeychainstore.

k06a avatar k06a commented on June 5, 2024

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.

rajohns08 avatar rajohns08 commented on June 5, 2024

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.

briankracoff avatar briankracoff commented on June 5, 2024

Getting the same bug here. Here's how I consistently reproduce it:

  1. Hit home button to put app into background
  2. Open up 6-10 other apps to make sure iOS puts it fully in the background
  3. Open app and quickly call stringForKey:error:. Receives error "Error getting keychain value: Security error has occurred."

from uickeychainstore.

pandaxbacon avatar pandaxbacon commented on June 5, 2024

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.

aryaxt avatar aryaxt commented on June 5, 2024

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.

jayztemplier avatar jayztemplier commented on June 5, 2024

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.

jayztemplier avatar jayztemplier commented on June 5, 2024

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.

theprojectabot avatar theprojectabot commented on June 5, 2024

@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.

jondal avatar jondal commented on June 5, 2024

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.

ilya-ramanenia avatar ilya-ramanenia commented on June 5, 2024

@jayztemplier same thing

from uickeychainstore.

dannyjiajia avatar dannyjiajia commented on June 5, 2024

anyone fix it?

from uickeychainstore.

theprojectabot avatar theprojectabot commented on June 5, 2024

@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.

dannyjiajia avatar dannyjiajia commented on June 5, 2024

@theprojectabot Your solution unfortunately did not work for me.I cached the value as @k06a

from uickeychainstore.

Mortenest avatar Mortenest commented on June 5, 2024

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.

cristiankocza-sv avatar cristiankocza-sv commented on June 5, 2024

@MortenFalcon happens to me too only while debugging, and not always.

from uickeychainstore.

allenhsu avatar allenhsu commented on June 5, 2024

+1 while debugging only

from uickeychainstore.

jakedunc avatar jakedunc commented on June 5, 2024

Why is this happening? Is there any fix?

from uickeychainstore.

gconno avatar gconno commented on June 5, 2024

Same issue here, only occurs sometimes, but its annoying because I use it to manage the state of the app.

from uickeychainstore.

gconno avatar gconno commented on June 5, 2024

+1 while debugging it appears. Doesnt affect the app on the store at the moment.

from uickeychainstore.

zhouzhuhao avatar zhouzhuhao commented on June 5, 2024

Is anybody solve this problem ?

from uickeychainstore.

zhouzhuhao avatar zhouzhuhao commented on June 5, 2024

OSStatus error: [-34018] Security error has occurred. this problem occurs sometimes,can anybody help me?

from uickeychainstore.

k06a avatar k06a commented on June 5, 2024

Just cache this value in property.

from uickeychainstore.

shekbagg avatar shekbagg commented on June 5, 2024

Any solution?

from uickeychainstore.

Blahartinger avatar Blahartinger commented on June 5, 2024

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.

dinhnhat0401 avatar dinhnhat0401 commented on June 5, 2024

@Blahartinger thanks for your helpful links.

from uickeychainstore.

luowenxing avatar luowenxing commented on June 5, 2024

I came across the same issue too.

from uickeychainstore.

greenzeal avatar greenzeal commented on June 5, 2024

Still there :)

from uickeychainstore.

zhao0 avatar zhao0 commented on June 5, 2024

Still there :)

from uickeychainstore.

MaxHasADHD avatar MaxHasADHD commented on June 5, 2024

Seeing this as well. Anyone have a fix?

from uickeychainstore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.