Where is the most appropriate place to stored an authenticated user's access token in an iOS App? -
this question has answer here:
i have api returns access token upon successful authentication (username, password). building ios app authenticates api. appropriate place store access token, , how implement it? seems nsuserdefaults
pretty easy use, seems intended storing user preferences.
any sensitive data should stored in keychain. correct, nsuserdefaults easy hacker read. take @ https://github.com/soffes/sskeychain.
a more barebones approach use wrapper apple provides. https://developer.apple.com/library/ios/samplecode/generickeychain/listings/classes_keychainitemwrapper_h.html
this shows more of implementation, requires tedious code.
also if you're using swift. https://github.com/deniskr/keychainswiftapi
Comments
Post a Comment