Overview
This guide shows how to implement passkey authentication using the Turnkey Kotlin SDK. You’ll add the necessary platform configuration, set up the provider with a properrpId, and call loginWithPasskey and signUpWithPasskey from your UI.
Passkey Setup
To enable passkeys, you must configure your app’s relying party ID (rpId) correctly.
For Android, you must configure a Digital Asset Links by setting up an assetlinks.json file. Refer to our relying party setup guide and Google’s Documentation.
1. Ensure rpId is set correctly in your Turnkey SDK initialization
Set the rpId to the domain you’ve associated (for example, yourdomain.com). This should match the domain configured in Digital Asset Links.
Usage
You can now callloginWithPasskey and signUpWithPasskey from your UI to handle passkey authentication.
Sign up with passkey
Log in with passkey
Tips
- Ensure your
rpIdmatches the domain configured in your Digital Asset Links otherwise authentication may fail. - For local testing, the simplest way to deploy a valid Digital Asset Links file is to set up a simple static file server and use a tunneling service like ngrok and LiveServer to expose it over HTTPS.
- For use in
Fragmentsyou userequireActivity()to get the activity reference.