The Antifraud Check module compares the current Session against prior Sessions and known identities to detect signs of fraud.
For an overview of this module and how it works, see Antifraud Check.
How you use this module depends on your integration pattern. In Patterns 1 and 2, you add the module to a FlowConfig in code as shown on this page. In Pattern 3, you define your modules and configuration in Dashboard as a Flow or Workflow and reference it by ID with startFlow() or startWorkflow() as shown on Run Flows Configured in Dashboard.
Add Antifraud
Add the module with addAntifraud(). Add Antifraud as the last module in your flow. The one exception is when you also use the Custom Watchlist module. In that case, call addAntifraud() first, then addCustomWatchlist().
flowConfigBuilder.addAntifraud()
flowConfigBuilder.addAntifraud();
Example
The example below adds Antifraud as the only step in the flow and listens for the result through onAntifraudCompleted().
val flowConfig = FlowConfig.Builder()
.addAntifraud()
.build()
val onboardingListener = object : OnboardingListener() {
override fun onAntifraudCompleted(antifraudResult: AntifraudResult) {
// Antifraud step completed. Process the result.
}
}
IncodeWelcome.getInstance()
.startOnboarding(activityContext, sessionConfig, flowConfig, onboardingListener)
FlowConfig flowConfig = new FlowConfig.Builder()
.addAntifraud()
.build();
IncodeWelcome.OnboardingListener onboardingListener = new IncodeWelcome.OnboardingListener() {
@Override
public void onAntifraudCompleted(@NonNull AntifraudResult antifraudResult) {
// Antifraud step completed. Process the result.
}
};
IncodeWelcome.getInstance()
.startOnboarding(activityContext, sessionConfig, flowConfig, onboardingListener);
Configuration Options
Antifraud has no configurable settings. It is constructed with a no-argument constructor, and addAntifraud() adds it for you.
Result
Antifraud delivers an AntifraudResult to the onAntifraudCompleted(AntifraudResult) callback on the OnboardingListener. Key fields include:
result:truewhen the antifraud check passed.- Fields inherited from
BaseResult:resultCode: TheResultCodefor this result.error: WhenresultCodeisERROR, theThrowablethat caused it; otherwise,null.deviceStats: TheDeviceStatssnapshot of the device state when the result was produced.motionStatus: Device motion assessment during capture. One of the following:UNCLEAR: Motion could not be determined; the default.PASS: Device motion was within acceptable limits.FAIL: Excessive device motion was detected.
Errors surface via OnboardingListener.onError(Throwable). This module does not deliver a module-specific exception subtype.
For all fields, see AntifraudResult in API Reference.