Class WebAuthnRegistration
- java.lang.Object
-
- org.forgerock.android.auth.webauthn.WebAuthn
-
- org.forgerock.android.auth.webauthn.WebAuthnRegistration
-
public class WebAuthnRegistration extends WebAuthn
Handle WebAuthn Registration
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.android.gms.fido.fido2.api.common.AttestationConveyancePreferenceattestationPreferenceprotected com.google.android.gms.fido.fido2.api.common.AuthenticatorSelectionCriteriaauthenticatorSelectionprotected byte[]challengeprotected java.lang.StringdisplayNameprotected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor>excludeCredentialsprotected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialParameters>pubKeyCredParamsprotected java.lang.StringrelyingPartyIdprotected java.lang.StringrelyingPartyNameprotected booleanrequireResidentKeyprotected java.lang.Doubletimeoutprotected java.lang.StringuserIdprotected java.lang.StringuserName-
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 WebAuthnRegistration(org.json.JSONObject input)Constructor to create WebAuthnRegistration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.android.gms.fido.fido2.api.common.AuthenticatorSelectionCriteriagetAuthenticatorSelectionCriteria(org.json.JSONObject value)Parse and retrieve AuthenticatorSelectionCriteria attributeprotected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor>getExcludeCredentials(org.json.JSONObject value)Parse and retrieve PublicKeyCredentialDescriptor attributeprotected java.util.List<com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialParameters>getPublicKeyCredentialParameters(org.json.JSONObject value)Parse and retrieve all the Public key credentialsprotected 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)protected booleanisRequireResidentKey(org.json.JSONObject value)Parse and retrieve requiredResidentKey attributeprotected voidpersist(android.content.Context context, PublicKeyCredentialSource source)Persist thePublicKeyCredentialSourcevoidregister(android.content.Context context, androidx.fragment.app.FragmentManager fragmentManager, WebAuthnListener listener)Perform WebAuthn Registration-
Methods inherited from class org.forgerock.android.auth.webauthn.WebAuthn
getCredentials, getRelyingPartyId, onWebAuthnException
-
-
-
-
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.UnsupportedOperationExceptionConstructor to create WebAuthnRegistration- Parameters:
input- The json from WebAuthn Registration Node- Throws:
org.json.JSONException- Failed to parse the Jsonjava.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.JSONExceptionParse 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.JSONExceptionParse 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.JSONExceptionParse 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.JSONExceptionParse 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 ContextfragmentManager- The FragmentManager to manage the lifecycle of Fido API Callbacklistener- The Listener for the result event.
-
persist
protected void persist(android.content.Context context, PublicKeyCredentialSource source)Persist thePublicKeyCredentialSource- Parameters:
context- The Application contextsource- ThePublicKeyCredentialSourceto persist
-
-