Reputation: 777
In the web API my app communicates with, the authentication process is designed in the following way:
group
that he/she belongs to.user name
and types a password
.group id
, user id
and password
to the server to validate the credentials and in case of successful validation uses this hash in further transactions.Having this process, I do not get standard NSURLConnection
messages like connection:canAuthenticateAgainstProtectionSpace:
or connection:didReceiveAuthenticationChallenge:
.
I can deal with it per se, but when it comes to securely storing the credentials, I get confused. Is there a way to do this via some built-in iOS SDK methods or I have to write the hash in a file manually, for example? What's the proper way?
Upvotes: 0
Views: 274
Reputation: 3955
The keychain seems the best option to store the user's credentials/hash. Check out http://developer.apple.com/library/mac/#documentation/Security/Conceptual/keychainServConcepts/iPhoneTasks/iPhoneTasks.html
Edit: Look at http://overhrd.com/?p=208 You'd be able to access the data on your keychain with simple calls of this nature:
[Keychain setString:@"hashhashhash" forKey:@"userHash"];
// later on…
[Keychain getStringForKey:@"userHash"];
Upvotes: 1