Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing passwords in iPhone applications

Tags:

I have a simple application, based of the "Utility Application" template. It retrieves a password-protected XML file (via NSXMLParser).

I want to allow the user to set a username and password in the "FlipsideView", how would I go about this?

I have the basics in place, the two UITextField boxes, the value of which gets set to a fixed value when the view loads (using the viewWillAppear method), and NSLog'd when the view is closed (the NSLog is just for testing, obviously, in the viewWillDisappear method)

How do I store the data? I've had a look at the Developer documentation, and it seems like I should be using NSUserDefaults..?

like image 728
dbr Avatar asked Feb 07 '09 11:02

dbr


People also ask

Can you save passwords for apps on iPhone?

Icon via Apple Inc. iCloud Keychain serves as a basic password manager for your iPhone and iPad. Through Keychain, you can save passwords for websites and apps and then retrieve them when you need to sign back into those sites and apps.

Does Apple have an app to store passwords?

iCloud Password Manager on Mac A legacy tool built into macOS called "Keychain Access" acts as a catch-all app for authentication certificates, passwords, and other security prompts. However, as of macOS Monterey, there's a more user-friendly option within the System Preferences app.

Is it a good idea to save passwords on iPhone?

Securely save them on your iPhone instead. If you deal with a significant number of websites and online services on a daily basis, then you must have lots of passwords to remember. Since using the same password for every account is not the best option, it's much safer to store the passwords on your iPhone.


1 Answers

I agree with Ben. This is exactly what the Keychain is for.

I would not, under any circumstances simply store passwords in the defaults as dbr suggests. This is highly insecure. You're essentially storing your passwords in the open.

In addition to Apple's sample code, I also recommend Buzz Anderson's Keychain code: iPhone Keychain Code

like image 70
August Avatar answered Oct 09 '22 16:10

August