This guide shows how to use passkeys with our React Native SDK, but you can just as easily use any
of our Mobile SDKs for Swift, Kotlin, or Flutter, or our Web
SDK for browser-based apps.
Github example code
Creating a passkey
Once a user has signed in using their email address or phone number, we can prompt them to create a passkey to use for next time.Prompting the user to create a passkey after sign-in
Lambda integration
To authorize binding the passkey to the user, we will create an authenticated endpoint which our app can call to obtain an Authsignal token. This endpoint will use a JWT Authorizer to authenticate using the Cognito access token.The value we provide for
action
here will be used to keep track of these events in the
Authsignal Portal.App integration
- Call our endpoint to obtain a short-lived Authsignal token.
- Set the Authsignal token using the React Native SDK.
- Create the passkey using the React Native SDK.
Signing in with a passkey
Now that the user has created a passkey, the next time they sign in we can present them with the option to use their passkey.Using a passkey to sign in
Lambda integration
No changes to our lambda code are required to handle passkeys as a sign-in method - our verify auth challenge response lambda will validate the token which we pass as the challenge answer.App integration
In our React Native app we’ll add some code to our sign-in screen to automatically show the passkey sign-in prompt if the user has one available on their device.useEffect
hook when our sign-in screen first appears.