Storing authentication tokens on iOS - NSUserDefaults vs Keychain?

前端 未结 3 1085
天涯浪人
天涯浪人 2020-11-30 22:04

Which is the place I should be storing tokens for when the user logins in to a service? I\'m not saving passwords (obviously where I\'d use the Keychain) but just the token.

3条回答
  •  情话喂你
    2020-11-30 22:51

    All sensitive data should be stored in the keychain. UserDefaults is for small pieces of data like user preferences.

提交回复
热议问题