Use this file to discover all available pages before exploring further.
Enrolling in MFA does not automatically verify the user for wallet operations. Once enrolled,
subsequent wallet actions will require MFA verification. See the verification
guides for how to complete MFA
verification.
Enroll users in MFA using passkeys, where they verify with a previously registered passkey through biometric authentication on their device.
In order to use passkeys as an MFA method, make sure a valid passkey is linked to the user. You
can set this up by following the steps here!
First, initiate enrollment by calling Privy’s initEnrollmentWithPasskey method with no parameters. This method returns a Promise that will resolve to void indicating success.
Then, to have the user enroll, you must call Privy’s submitEnrollmentWithPasskey method with a list of the user’s passkey account credentialIds. You can find this list by querying the user’s linkedAccounts array for all accounts of type: 'passkey':
To enroll passkeys as an MFA method, call Privy’s submit method with the list of passkey credential IDs that should be enabled for MFA. You can find the credential IDs from the user’s linked accounts:
guard let user = await privy.getUser() else { return }// Get credential IDs from linked passkey accountslet credentialIds = user.linkedAccounts .compactMap { account -> String? in if case .passkey(let passkey) = account { return passkey.credentialId } return nil }// Submit credential IDs to complete enrollmentlet updatedUser = try await user.mfa.passkeys.enroll.submit(credentialIds: credentialIds)// The updated user object will contain the newly enrolled mfaMethodprint(updatedUser.mfaMethods)
To enroll passkeys as an MFA method, call Privy’s submit method with the list of passkey credential IDs that should be enabled for MFA. You can find the credential IDs from the user’s linked accounts:
val user = privy.getUser() ?: return// Get credential IDs from linked passkey accountsval credentialIds = user.linkedAccounts .filterIsInstance<LinkedAccount.Passkey>() .map { it.credentialId }// Submit credential IDs to complete enrollmentuser.mfa.passkeys.enroll.submit(credentialIds) .onSuccess { updatedUser -> // The updated user object will contain the newly enrolled mfaMethod println(updatedUser.mfaMethods) } .onFailure { error -> // Handle error }