I’m currently using Apple’s KeychainWrapper to store a single username and password, but i’d like to add the functionality of being able to login to different accounts, and switching between them in my app.
Is it a matter of storing identifiers for different keychains in a plist, and then re-initializing the keychain each time I want to change account? or is there a better approach to this? maybe a NSMutableArray of keychains?
Thanks,
Nick.
I suggest you to check the open source SFHFKeychainUtils class.
It is extremely simple, you just need to call one method to add (or update):
…one method to get the stored password:
…and one method to delete:
It is available in GitHub. You just need to drag and drop the classes and import the Security framework to your project.