Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using keychain to store username and password in xcode 4

I don't want to use NSUserDefaults as I have been told it's not a good way to save a username and password.

So I was going to use a Keychain, but I have never used them before. Can some one please just a give a quick example of one or point me in the direction of an example ? Thanks.

like image 620
Popeye Avatar asked Dec 20 '11 08:12

Popeye


People also ask

Is iOS keychain A good password manager?

Is Apple's Password Manager Safe? Apple's own iCloud Keychain is a solid password manager, much better than Chrome's built-in option. Built around Apple's secure iCloud service — which you can learn about in our iCloud Drive review — Keychain offers a convenient and free way to store passwords on the go.

How do I save passwords in keychain on Mac?

Open System Preferences, click the icon for Apple ID, and click the checkbox for Keychain. Then when you browse to a password-protected website, iCloud Keychain will ask if you want to save the password. Click Save Password and it'll be securely stored in your Keychain.

What is keychain in Xcode?

In iOS, apps have access to a single keychain (which logically encompasses the iCloud keychain). This keychain is automatically unlocked when the user unlocks the device and then locked when the device is locked. An app can access only its own keychain items, or those shared with a group to which the app belongs.


1 Answers

I Use the open source SSKeychain wrapper around the the C api used by the keychain.

It's convenient, easy to use, and works on Mac OS and iOS.

like image 200
Abizern Avatar answered Nov 14 '22 23:11

Abizern