Learn how to integrate passkey authentication into your native iOS and Android apps using the Corbado iOS SDK and Corbado Android SDK. This guide covers setup, passkey enrollment, login, and management.
README
in our GitHub repositories. The README
provides a comprehensive guide to getting the SDK set up in your project.
getConnectToken()
, you must provide the user’s accessToken
to enable the backend to verify their authenticated state.
accessToken
for demonstration purposes. This token is typically a JWT issued by your Identity Provider (IdP) after a user authenticates.isAppendAllowed()
method from the Corbado iOS/Android SDK. This function is crucial for determining if the current user is eligible to add a passkey, based on your configurations for Gradual Rollout and Passkey Intelligence.
The method requires a connectTokenProvider
, a closure that fetches a connectToken from your backend. We’ll use the AppBackend
helper class defined previously. You need to provide the user’s current accessToken
so your backend can verify their authenticated state before generating the token.
completeAppend()
method from the Corbado iOS/Android SDK. This function initiates the native passkey creation ceremony, which securely interacts with the device’s hardware and Corbado’s backend.
The method returns a status indicating the outcome of the ceremony, which you should handle accordingly.
accessToken
from your system.
The complete flow is illustrated in detail in our User Login Flow documentation.
isLoginAllowed()
method from the Corbado iOS/Android SDK. This function is crucial for determining if the current user is eligible to use a passkey, based on your configurations for Gradual Rollout and Passkey Intelligence.
loginWithoutIdentifier()
method from the Corbado iOS/Android SDK.
If the login has been successful (.done
/ .Done
), you must verify the returned signedPasskeyData with your backend using the helper method verifySignedPasskeyData()
implemented earlier.
loginWithIdentifier()
method from the Corbado iOS/Android SDK.
Just like with other flows, a successful login returns .done
/ .Done
with signedPasskeyData, which you must verify with your backend.
loginWithOneTap()
.
The subsequent steps for handling the response are identical to the Textfield Login flow: you will need to handle the different cases returned by the method and ultimately verify the signedPasskeyData with your backend.
connectTokenProvider
. This is a closure that the SDK calls just before executing an operation to get a fresh connectToken. You can reuse the AppBackend
helper class for this.
isManageAppendAllowed()
method from the Corbado iOS/Android SDK conveniently provides both pieces of information in a single call.
This eligibility check is governed by your project’s settings for Gradual Rollout and Passkey Intelligence. The method returns the list of existing passkeys along with a status indicating if the “Add new passkey” button should be displayed.
deletePasskey()
method from the Corbado iOS/Android SDK.
This operation also requires authorization, so you must provide the same connectTokenProvider
as before to generate a fresh connectToken of type PasskeyDelete
.
isManageAppendAllowed()
method), your UI should present an “Add new passkey” button. When the user taps this button, you call the completePasskeyListAppend()
method from the Corbado iOS/Android SDK.
This function initiates the native passkey creation ceremony. It requires a connectTokenProvider
to authorize the action, but for this operation, you must request a connectToken of type PasskeyAppend
from your backend.