peterferguson / react-native-passkeys

56 stars 6 forks source link

Android Development Build: Error NotConfigured #9

Closed adrianofoschi closed 4 months ago

adrianofoschi commented 4 months ago

On passkey.create I have this error Error: NotConfigured

The code:

  ...
    const rp = {
      id: 'mydomain.com',
      name: 'mydomain.com',
    } satisfies PublicKeyCredentialRpEntity;

    const user = {
      id: utils.encodeBase64url(new TextEncoder().encode(nickname)),
      displayName: nickname,
      name: nickname,
    } satisfies PublicKeyCredentialUserEntityJSON;

    const authenticatorSelection = {
      userVerification: "preferred",
      residentKey: "preferred",
    } satisfies AuthenticatorSelectionCriteria;

    try {
      const json = await passkey.create({
        challenge,
        pubKeyCredParams: [{ alg: -7, type: "public-key" }],
        rp,
        user,
        authenticatorSelection,
        attestation: 'none'
      });
   catch(e) {
     console.log(e)
   }

passkey.isSupported() returns true

I created an expo development build locally (build.apk) then I extracted the certificate with

keytool -printcert -jarfile build.apk

Finally I put the certificate in mydomain.com/.well-known/assetslink.json

adrianofoschi commented 4 months ago

It was related to lineagesOS custom ROM. It works perfectly with stock android.