Class WebAuthnRegistration


  • public class WebAuthnRegistration
    extends WebAuthn
    Handle WebAuthn Registration
    • Field Detail

      • relyingPartyName

        protected final java.lang.String relyingPartyName
      • attestationPreference

        protected final com.google.android.gms.fido.fido2.api.common.AttestationConveyancePreference attestationPreference
      • displayName

        protected final java.lang.String displayName
      • relyingPartyId

        protected final java.lang.String relyingPartyId
      • userName

        protected final java.lang.String userName
      • authenticatorSelection

        protected final com.google.android.gms.fido.fido2.api.common.AuthenticatorSelectionCriteria authenticatorSelection
      • requireResidentKey

        protected final boolean requireResidentKey
      • userId

        protected final java.lang.String userId
      • timeout

        protected final java.lang.Double timeout
      • excludeCredentials

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

        protected final java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialParameters> pubKeyCredParams
      • challenge

        protected final byte[] challenge
    • Constructor Detail

      • WebAuthnRegistration

        public WebAuthnRegistration​(org.json.JSONObject input)
                             throws org.json.JSONException,
                                    java.lang.UnsupportedOperationException
        Constructor to create WebAuthnRegistration
        Parameters:
        input - The json from WebAuthn Registration Node
        Throws:
        org.json.JSONException - Failed to parse the Json
        java.lang.UnsupportedOperationException
    • Method Detail

      • getPublicKeyCredentialParameters

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

        protected boolean isRequireResidentKey​(org.json.JSONObject value)
                                        throws org.json.JSONException
        Parse and retrieve requiredResidentKey attribute
        Parameters:
        value - The json from WebAuthn Registration Node
        Returns:
        The parsed requiredResidentKey.
        Throws:
        org.json.JSONException - Failed to parse the Json
      • getAuthenticatorSelectionCriteria

        protected com.google.android.gms.fido.fido2.api.common.AuthenticatorSelectionCriteria getAuthenticatorSelectionCriteria​(org.json.JSONObject value)
                                                                                                                         throws org.json.JSONException
        Parse and retrieve AuthenticatorSelectionCriteria attribute
        Parameters:
        value - The json from WebAuthn Registration Node
        Returns:
        The parsed AuthenticatorSelectionCriteria.
        Throws:
        org.json.JSONException - Failed to parse the Json
      • getExcludeCredentials

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

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

        public void register​(@NonNull
                             android.content.Context context,
                             @NonNull
                             androidx.fragment.app.FragmentManager fragmentManager,
                             @NonNull
                             WebAuthnListener listener)
        Perform WebAuthn Registration
        Parameters:
        context - The Application Context
        fragmentManager - The FragmentManager to manage the lifecycle of Fido API Callback
        listener - The Listener for the result event.