 <p>You can simply use <code>NSURLCredential</code>, it will save both username and password in the keychain.</p> <p>See my detailed answered on <a href="http://stackoverflow.com/a/17997943/249869">http://stackoverflow.com/a/17997943/249869</a>.</p>