Class Fido2Config
The SDK is designed with secure defaults. This class provides a limited set of options for applications that need to customize certain security features or behaviors, such as rate limiting, logging, and TLS certificate pinning.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetAuthenticatorAaguid(String aaguid, VerifyMethod verifyMethod) Configures a custom AAGUID for enrollments performed with the specified verify method.static voidsetBaseLockoutDuration(int durationInSecs) Sets the base duration for the lockout penalty after too many failed verification attempts.static voidsetMaximumRetryCount(int maxRetryCount) Sets the maximum number of failed user verification attempts before the authenticator is locked.static voidsetSecureLog(com.thalesgroup.gemalto.securelog.SecureLog securelog) Sets a pre-configured secure logger instance for the SDK to use.static voidsetTlsCertificates(X509Certificate[] certificates) Sets the TLS certificates to be used for certificate pinning when communicating with the Relying Party.static com.thalesgroup.gemalto.securelog.SecureLogsetUpSecureLog(com.thalesgroup.gemalto.securelog.SecureLogConfig config) Configures and initializes the secure logger for the SDK.
-
Constructor Details
-
Fido2Config
public Fido2Config()
-
-
Method Details
-
setMaximumRetryCount
public static void setMaximumRetryCount(int maxRetryCount) Sets the maximum number of failed user verification attempts before the authenticator is locked.This value can only be configured once per application runtime. Subsequent calls will be ignored.
- Default value: 5
- Minimum value: 1
- Maximum value: 5
- Parameters:
maxRetryCount- The maximum number of retries.- Since:
- 1.0.0
-
setBaseLockoutDuration
public static void setBaseLockoutDuration(int durationInSecs) Sets the base duration for the lockout penalty after too many failed verification attempts.The actual lockout duration increases exponentially with each subsequent lockout. This value can only be configured once per application runtime. Subsequent calls will be ignored.
- Default value: 30 seconds
- Minimum value: 30 seconds
- Maximum value: 1800 seconds (30 minutes)
- Parameters:
durationInSecs- The base lockout duration in seconds.- Since:
- 1.0.0
-
setUpSecureLog
public static com.thalesgroup.gemalto.securelog.SecureLog setUpSecureLog(@Nullable com.thalesgroup.gemalto.securelog.SecureLogConfig config) Configures and initializes the secure logger for the SDK.- Parameters:
config- The configuration for the secure logger.- Returns:
- An instance of
SecureLog, ornullif the provided config isnull. - Since:
- 1.2.0
-
setSecureLog
public static void setSecureLog(@Nullable com.thalesgroup.gemalto.securelog.SecureLog securelog) Sets a pre-configured secure logger instance for the SDK to use.- Parameters:
securelog- A previously createdSecureLoginstance.- Since:
- 1.2.0
-
setTlsCertificates
Sets the TLS certificates to be used for certificate pinning when communicating with the Relying Party.This enhances security by ensuring the app communicates only with servers that have a trusted certificate. If this is not set, standard system trust validation will be used.
- Parameters:
certificates- An array ofX509Certificateto pin against.- Since:
- 1.9.0
-
setAuthenticatorAaguid
public static void setAuthenticatorAaguid(@NonNull String aaguid, @NonNull VerifyMethod verifyMethod) throws Fido2Exception Configures a custom AAGUID for enrollments performed with the specified verify method.New enrollments using the given verify method will embed the provided AAGUID in their attestation data instead of the SDK's built-in default. Previously completed enrollments are unaffected by this configuration — existing credentials remain fully valid.
The
VerifyMethod.PLATFORMandVerifyMethod.NONEverify methods are not configurable. The platform AAGUID is always00000000000000000000000000000000as required by the FIDO2 specification.Warning: This method must be called before any FIDO2 operation (registration or authentication). The configuration is stored in memory for the lifetime of the process only — it is not persisted across process launches. This means it must be called on every launch of every process that performs FIDO2 operations. The recommended call site is during application startup, before initialising any
Fido2Clientinstance.- Parameters:
aaguid- A 32-character lowercase hexadecimal string representing the AAGUID (e.g."27ae41e4649b934ca495991b7852b855"). Must not benull. Dashes, braces, and uppercase letters are not accepted. All-zeros values are not accepted.verifyMethod- The verify method for which to apply the AAGUID override. Must beVerifyMethod.BIOMETRICorVerifyMethod.PASSCODE.- Throws:
Fido2Exception- withFido2ErrorCode.ERROR_INVALID_AAGUIDifaaguidisnull, not a valid 32-character lowercase hex string, or is all zeros.Fido2Exception- withFido2ErrorCode.ERROR_NOT_ALLOWEDifverifyMethodisVerifyMethod.PLATFORMorVerifyMethod.NONE.Fido2Exception- withFido2ErrorCode.ERROR_UNSAFE_ENVIRONMENT_DETECTEDif a debugger or hook is detected.- Since:
- 4.1.0
-