objective c - How can I enable access of NSURLCredentials when an iOS Device is locked? -


i using swagger generated swift client uses nsurlcredentials authenticate server. using persistence type .permanent app communicates server in background , works fine, except when lock phone (i see 401 errors in log). believe nsurlcredential not able access keychain when phone locked. came across posts talk enabling keychain access using ksecattraccessibleafterfirstunlock. haven't been able figure out how nsurlcredential. know if , how can configured?

yes, that's happening, in likelihood. have couple of options:

  • delete underlying keychain item , recreate it, specifying should accessible when device unlocked. don't need use nsurlcredential @ approach. create internet password item using keychain services apis , credential store should pick automatically.
  • keep credential data in memory, , implement urlsession:task:didreceivechallenge:completionhandler: delegate method in session delegate (or equivalent method nsurlconnection if you're using api) provide credential when asked.

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -