peterferguson / react-native-passkeys

78 stars 10 forks source link

"Error: NotSupported" even though `isSupported()` returns `true` #13

Closed getify closed 3 weeks ago

getify commented 4 months ago

I'm having trouble getting this to work on my Android phone (oneplus 10pro with android 14 on it). As far as I can tell, it has the necessary pieces, as evidenced by the example code from this repository.

try {
  console.log(`isSupported: ${passkeys.isSupported()}`);

  let result = await passkeys.create({
    authenticatorSelection: {
      userVerification: "required",
      residentKey: "required",
    },
    pubKeyCredParams: [
      { alg: -7, type: "public-key" },
    ],
    rp: {
      id: "com.whatever",
      name: "Whatever App",
    },
    challenge: "hello world",
    user: {
      name: "whatever-user",
      displayName: "Whatever User",
      id: "123456",
    },
  });
  console.log("result");
  console.dir(result);
}
catch (err) {
  console.log(err.toString());
}

This code prints:

isSupported: true
Error: NotSupported

I don't understand that confusing outcome.

Do you have any insight? Any idea how I might figure out what's going on?

peterferguson commented 1 month ago

Hey sorry for getting back so late on this one did you manage to fix the issue?

I haven't managed to replicate this with a similar setup