Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to maintain the login credentials in iOS?

I need to maintain my log-in credential for throughout the app so, I have 3 options to maintain my log-in credentials...

1 key chain
2 NSUserDefaults
3 plist

Which one is best one to choose ? Is there any other way is there to store the log-in credentials?

Thanks in advance

like image 312
Arun Avatar asked Nov 20 '12 03:11

Arun


People also ask

Does iPhone have keychain?

iCloud Keychain keeps your passwords, passkeys, and other secure information updated across your iPhone, iPad, iPod touch, or Mac. Set up iCloud Keychain.

How are user credentials stored?

There are two main types of authentication stores being used with IdPs today: databases and directory stores. In general, with databases, credentials are stored in proprietary tables created by the user management application.

Where should credentials used in your application be stored?

An application must receive credentials from somewhere to use services it depends on. These credentials are usually stored in configuration files.


1 Answers

I'll suggest keychain for storing the login credentials due to the security feature it provides. The keychain services on iOS provide a means to securely store content such as passwords, keys, certificates, etc.

Sensitive data like passwords and keys should be stored in the Keychain. Apple's Keychain Services Programming Guide states that

"A keychain is an encrypted container that holds passwords for multiple applications and secure services. Keychains are secure storage containers, which means that when the keychain is locked, no one can access its protected contents".

Here is two nice tutorial for you.

  1. How Not to Store Passwords in iOS
  2. Using Keychain to Store Username and Password
  3. How to secure user data
like image 182
Midhun MP Avatar answered Oct 01 '22 18:10

Midhun MP