-1

Can you suggest a good, safe way to save and show the username and password of the user so they can be shown on the login page?

I know that using NSUserDefaults is not very secure so it's not a good way to use it for storing the password for accessing my app.

Can you tell me which third-party (in Objective-C) methods and libraries can I use to ensure safe results?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
kAiN
  • 2,559
  • 1
  • 26
  • 54

1 Answers1

3

You should use NSURLCredential, it will save username and password in the keychain in just two lines of code.

This is detailed answer

Anton Rodzik
  • 781
  • 4
  • 14
  • I do not understand how to remove a credential ... do I need a web address to manage loginProtectionSpace as in the example? – kAiN Oct 02 '18 at 19:04
  • I'd +1000 if I could... I've been using the Keychain Services API since I began as an iOS dev with iOS 3. How I've never been aware of `NSURLCredential` I'll never know! Thanks! – Pete Morris Oct 03 '18 at 05:17