kSecAttrAccessibleAlways deprecated in ios 9
Asked Answered
W

2

6

I use keychain to authenticate and then send location info to server in background.

But since kSecAttrAccessibleAlways got depricated, I will have to use kSecAttrAccessibleAfterFirstUnlock. This allows use of keychain after first unlock after restarting phone.

Problem is if user restarts phone, and location changes before first unlock, then Authenticate will fail, since we can't fetch from keychain.

How can I solve this problem. How to find keychain cannot be accessed and stop authentication process.

Thanks.

Wilcher answered 20/8, 2015 at 8:0 Comment(1)
Where does it say it is deprecated? I can use it without warningNice
P
1

How would your app ever be running before the user first unlocks the device and launches it?

BTW, according to the latest docs, kSecAttrAccessibleAlways isn't deprecated. Maybe I'm missing something....

Pavis answered 16/9, 2015 at 5:54 Comment(3)
Issue is if there is any background service enabled eg location.Wilcher
Apple mentioned at the WWDC15 session 706 Security and Your Apps (at~ 27:25) that kSecAttrAccessibleAlways will be deprecated in iOS 9Pierian
And yet they did not actually deprecate it. This tells me that they initially made the same assumptions that I did, and that developers then provided them with a list of apps that can't work correctly without the kSecAttrAccessibleAlways flag, and they changed their minds. This isn't the first time that sort of thing has happened. :-)Pavis
B
1

This depends on your exact setup. For example, VoIP and region monitoring can auto launch the app before first unlock. Apple Watch enabled apps can start the phone app from background before the phone's first unlock. However, all other services including background fetch will not activate after restart of the phone until the user first enters their passcode so you are safe for those scenarios. But for region monitoring, a solution could be to change the functionality so that the user has to open the app once after first unlock to authenticate and send information to server. For example, cache the location data in the background and then when the user opens the app have it continue with the intended functionality.

Bioscopy answered 5/2, 2016 at 18:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.