Android's Credential Manager API introduces Restore Credentials, a feature that enables users to get into their accounts on a new device with ease. Restore Credentials allows app developers to onboard users onto their accounts on a new phone without the need to re-enter login credentials. The feature ensures a seamless transition between devices and removes the friction of having to restore apps and data from a previous device. Additionally, apps can opt for automatic login for their users as soon as the restore is completed, as well as send notifications on the user's content without requiring them to access the app on the new device.
One of the benefits of Restore Credentials is that there is no developer effort required to transfer a restore key from one device to another, as this process is tied to Android's system backup and restore mechanism. However, if developers want to automatically log in users as soon as the restore is completed, they can opt to implement BackupAgent and add their logic in the onRestore callback.
Apps can check for a restore key upon first launch and then log the user in automatically if they are not using BackupAgent. The Restore Credentials feature leverages the same server-side implementation used for passkeys, making it easy for developers to implement Restore Credentials.
The Restore Credentials feature enables seamless user account restoration on a new device. This occurs during device setup when a user restores apps and data from a previous device. The restore key, which is generated on the old device, is stored locally and backed up to the cloud, allowing the new device to have access to it for automatic login. Users can choose to restore data from a cloud backup or local transfer.
The minimum version of the Jetpack Library required to use Restore Credentials is 1.5.0-beta01, and the minimum GMS version is 242200000. The feature is available through the Credential Manager Jetpack library.
Benefits of the Restore Credentials feature include seamless user experience during a user's transition to a new Android device, immediate engagement through notifications or other prompts as soon as users start using their new device, and easy implementation as it leverages existing passkey server-side infrastructure for apps.
To implement Restore Credentials with Jetpack Credential Manager, app developers need to create a restore credential, get the restore credential, and clear the restore credential. The feature leverages restore key, which is a public key compatible with passkey/FIDO2 backends.
The Restore Credentials feature is a valuable tool that delivers a practical and user-friendly authentication solution. For developers, it is straightforward to integrate and leverages existing passkey server-side infrastructure.
Restore Credentials is a part of the Spotlight Week: Passkeys series, which delivers informative blog posts, engaging videos, and practical sample code to help app developers leverage the latest advancements in seamless sign-up and sign-in experiences.
The Restore Credentials feature enhances security, reduces friction for users, and keeps app developers ahead of the curve in the rapidly evolving landscape of digital identity.