Ionic capacitor passkey WebAuthn on iOS

230 views Asked by At

I am building an app using Ionic framework and I'm trying to use passkey for user to be able to register and use the app passwordless. I have been able to make passkey works on browser and Android, but could not achieve this on iOS with error message "WebAuthn not implemented on ios". I am using Capacitor 5, tested on iOS device with iOS 16. I am using a package from https://www.npmjs.com/package/@joyid/capacitor-native-passkey

enter image description here

My code is as follow:

import { WebAuthn as IOSWebAuthn } from '@joyid/capacitor-native-passkey';

export class Mypage {

  async passkeyRegister() {
    const resp = await this.utilService.get('req_register_passkey_otp');
    // Get the challenge from server

    try {
      // pass the challenge to Webauthn to get keys
      // always get error that is not implemented on ios
      attResp = await IOSWebAuthn.create(resp.data.passkeyRegOption);
    } catch (error) {
    }
}

I have also added the web credentials and set up domain association as mentioned in the configuration here: https://github.com/f-23/react-native-passkey. How could I make passkey to work on iOS? Thank you in advance.

0

There are 0 answers