Search code examples
iosswiftkeychain

Shoud I store user-identifier in keychain using sign in with apple?


I'm implementing sign in with Apple referencing Apple's sample apple (Juice).

in Sample app, after authorize completed, save user identifier in keychain.

// For the purpose of this demo app, store the `userIdentifier` in the keychain.
self.saveUserInKeychain(userIdentifier)

I think, it is good solution for saving and restoring userIdentifier.

but description in code block, said it is purpose of demo app. It's OK if i store useridentifier in keychain?


Solution

  • Yes, it's fine. Store "userIdentifier" on your server because if a user resets the device || root a device, then you will lose this info. So it's always better to store it on the server.