Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: FIDO2 package taking too much time to sign a challenge #7388

Open
1 of 3 tasks
franelias opened this issue Apr 8, 2024 · 2 comments
Open
1 of 3 tasks

[Bug]: FIDO2 package taking too much time to sign a challenge #7388

franelias opened this issue Apr 8, 2024 · 2 comments
Labels

Comments

@franelias
Copy link

Capacitor Version

@capacitor/cli: 5.2.3
@capacitor/core: 5.2.3
@capacitor/ios: 5.2.3
@capacitor/android: 5.2.3

Other API Details

node --version
v18.16.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

Hi, I have implemented the package com.google.android.gms:play-services-fido:20.0.1 as a plugin in my Capacitor app as it follows:

    @Override
    public void load() {
        authIntentLauncher = bridge.registerForActivityResult(new ActivityResultContracts.StartIntentSenderForResult(),
                getAuthIntentCallback());
    }

    @PluginMethod()
    public void getCredential(PluginCall call) {
        Fido2ApiClient fidoClient = Fido.getFido2ApiClient(bridge.getContext());
        PendingIntent intent = null;
        CredentialParser parser = new CredentialParser();
        JSObject credentialOptions = call.getObject("publicKey", new JSObject());

        try {
            PublicKeyCredentialRequestOptions credentials = parser.ParseLogin(credentialOptions);
            if (credentials == null) {
                call.reject("null credentials");
                return;
            }

            Task<PendingIntent> taskIntent = fidoClient.getSignPendingIntent(credentials);
            intent = Tasks.await(taskIntent);
        } catch (Exception e) {
            call.reject(e.getMessage());
            return;
        }

        if (intent != null) {
            IntentSenderRequest.Builder builder = new IntentSenderRequest.Builder(intent);

            pluginCall = call;
            authIntentLauncher.launch(builder.build());
        } else {
            call.reject("null intent");
        }
    }

My problem is that this implementation take about 5-11 seconds to show the fingerprint prompt and sign the challenge while in other frameworks, this delay doen't exist.

Expected Behavior

The biometric prompt should not take much time to appear.

Project Reproduction

It can be reproduced following the Google Codelab https://codelabs.developers.google.com/codelabs/fido2-for-android

Additional Information

No response

@franelias franelias changed the title [Bug]: [Bug]: FIDO2 package taking too much time to sign a challenge Apr 8, 2024
@FernetB
Copy link

FernetB commented Apr 8, 2024

I am having the same issue and i think is in the bridge.registerForActivityResult but i don't know what to do with that

@FernetB
Copy link

FernetB commented Apr 23, 2024

Hi! someone will see this? is a huge blocker for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants