Class WebAuthnAuthentication


  • public class WebAuthnAuthentication
    extends WebAuthn
    Handle WebAuthn Authentication
    • Field Detail

      • allowCredentials

        protected final java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor> allowCredentials
      • relayingPartyId

        protected final java.lang.String relayingPartyId
      • timeout

        protected final java.lang.Double timeout
      • challenge

        protected final byte[] challenge
      • userVerification

        protected final java.lang.String userVerification
    • Constructor Detail

      • WebAuthnAuthentication

        public WebAuthnAuthentication​(org.json.JSONObject input)
                               throws org.json.JSONException
        Constructor to create WebAuthnAuthentication
        Parameters:
        input - The json from WebAuthn Authentication Node
        Throws:
        org.json.JSONException - Failed to parse the Json
    • Method Detail

      • getAllowCredentials

        protected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor> getAllowCredentials​(org.json.JSONObject value)
                                                                                                                          throws org.json.JSONException
        Parse and retrieve all the allow credentials
        Parameters:
        value - The json from WebAuthn Authentication Node
        Returns:
        The parsed PublicKeyCredentialDescriptor
        Throws:
        org.json.JSONException - Failed to parse the Json
      • authenticate

        public void authenticate​(@NonNull
                                 android.content.Context context,
                                 @NonNull
                                 androidx.fragment.app.FragmentManager fragmentManager,
                                 @Nullable
                                 WebAuthnKeySelector webAuthnKeySelector,
                                 @NonNull
                                 WebAuthnListener listener)
        Perform WebAuthn Authentication
        Parameters:
        context - The Application Context
        fragmentManager - The FragmentManager to manage the lifecycle of Fido API Callback
        webAuthnKeySelector - The Selector for user to select which credential to use (UsernameLess)
        listener - The Listener for the result event.
      • getSignPendingIntent

        protected com.google.android.gms.tasks.Task<android.app.PendingIntent> getSignPendingIntent​(com.google.android.gms.fido.fido2.Fido2ApiClient fido2ApiClient,
                                                                                                    com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialRequestOptions options)
      • authenticate

        protected void authenticate​(android.content.Context context,
                                    androidx.fragment.app.FragmentManager fragmentManager,
                                    WebAuthnListener listener,
                                    java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor> allowCredentials,
                                    byte[] userHandle)