Skip to content

Saving Authentication Credentials #2

wants to merge 3 commits into from

2 participants

dlinsin commented Oct 7, 2012

This introduces saving the Authentication Credentials in iOS's Keychain.

It uses a submodule which simplifies the Keychain access tremendously: UICKeyChainStore. Unfortunately, it's not ARC compatible so I had to add the flag -fno-objc-arc to the two source files.

The credentials are stored once the authorization succeeded and used as soon as an TPTentHTTPClientinstance is created with the same URL.

Unfortunately, I had to change AccountViewController a little bit to adjust the flow.

Note: there is no error handling or logging out! You'd basically have to login with a different entity in order to overwrite the Keychain entries!


Thanks for this @dlinsin.

I'm quite keen to reduce dependencies on external libraries to just AFNetworking (had planned to deprecate the need for SSToolkit shortly).

With that in mind, I've implemented something functionally similar using Apple's Keychain API: 545c7c0. Doing it direct also means creds are more correctly stored using the kSecClass for crypto keys rather than user passwords.

Thanks heaps for the pull request though, and let me know if you think there's any issues or shortcomings in the current implementation.

@followben followben closed this Oct 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.