Recovering Sessions
By default, the SDK will require users to sign in everytime the app is closed completely. This is because, by default, we do not write the session wallet information (e.g. private keys) to any form of persistent storage for user security.
However, on select platforms, we have integrated with the platform's native secure storage offering.
If you enable StoreSessionPrivateKeyInSecureStorage
in your SequenceConfig
ScriptableObject, we will automatically store the session wallet information for you (on supported platforms) and expose the ability to attempt to recover the session in SequenceLogin
. The default LoginPanel
will automatically handle the UI flow for this as well (see Authentication). If the platform is not supported, this flag will have no effect.
See below the supported platforms and to learn about the platform's secure storage solution - it is important to understand the basics of how these systems work and think carefully about the security implications of storing private keys (or any secret for that matter) in persistent storage.
iOS
On iOS, we leverage the iOS Keychain.
MacOS
On MacOS, we leverage the MacOS Keychain.
Windows
On Windows PCs, we leverage the Crypto: Next Generation - Data Protection API (CNG DPAPI)
Web
On Web builds, we leverage IndexedDB via PlayerPrefs.
Editor
In the editor, we leverage the MacOS and PC secure storage solutions depending on which version of the editor you are using. You will also need to enable 'EditorStoreSessionPrivateKeyInSecureStorage' in SequenceConfig in order to use secure storage and recover sessions from within the editor. This separate flag makes it easier for you to test both flows without modifying the behaviour of your builds.