Class WebAuthnAuthentication
- java.lang.Object
-
- org.forgerock.android.auth.webauthn.WebAuthn
-
- org.forgerock.android.auth.webauthn.WebAuthnAuthentication
-
public class WebAuthnAuthentication extends WebAuthn
Handle WebAuthn Authentication
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor>allowCredentialsprotected byte[]challengeprotected java.lang.StringrelayingPartyIdprotected java.lang.Doubletimeoutprotected java.lang.StringuserVerification-
Fields inherited from class org.forgerock.android.auth.webauthn.WebAuthn
_ACTION, _ALLOW_CREDENTIALS, _AUTHENTICATOR_SELECTION, _EXCLUDE_CREDENTIALS, _PUB_KEY_CRED_PARAMS, _TYPE, ALG, ALLOW_CREDENTIALS, ATTESTATION_PREFERENCE, AUTHENTICATOR_ATTACHMENT, AUTHENTICATOR_SELECTION, CHALLENGE, DISPLAY_NAME, EXCLUDE_CREDENTIALS, PUB_KEY_CRED_PARAMS, RELYING_PARTY_NAME, REQUIRE_RESIDENT_KEY, REQUIRED, TIMEOUT, TIMEOUT_DEFAULT, TYPE, USER_ID, USER_NAME, USER_VERIFICATION, WEB_AUTHN, WEBAUTHN_AUTHENTICATION, WEBAUTHN_REGISTRATION
-
-
Constructor Summary
Constructors Constructor Description WebAuthnAuthentication(org.json.JSONObject input)Constructor to create WebAuthnAuthentication
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate(android.content.Context context, androidx.fragment.app.FragmentManager fragmentManager, WebAuthnKeySelector webAuthnKeySelector, WebAuthnListener listener)Perform WebAuthn Authenticationprotected voidauthenticate(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)protected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor>getAllowCredentials(org.json.JSONObject value)Parse and retrieve all the allow credentialsprotected java.util.List<PublicKeyCredentialSource>getPublicKeyCredentialSource(android.content.Context context)Retrieve thePublicKeyCredentialSourceprotected 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)-
Methods inherited from class org.forgerock.android.auth.webauthn.WebAuthn
getCredentials, getRelyingPartyId, onWebAuthnException
-
-
-
-
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
-
-
Method Detail
-
getAllowCredentials
protected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor> getAllowCredentials(org.json.JSONObject value) throws org.json.JSONExceptionParse 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 ContextfragmentManager- The FragmentManager to manage the lifecycle of Fido API CallbackwebAuthnKeySelector- The Selector for user to select which credential to use (UsernameLess)listener- The Listener for the result event.
-
getPublicKeyCredentialSource
protected java.util.List<PublicKeyCredentialSource> getPublicKeyCredentialSource(android.content.Context context)
Retrieve thePublicKeyCredentialSource- Parameters:
context- The Application Context- Returns:
- The stored
PublicKeyCredentialSource
-
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)
-
-