Quick Start
Requirements
- Android 7.0 or later (minimum API level 24)
- Android Gradle Plugin 8.7.3 or later
- Kotlin Gradle plugin 1.9.24 or later
- An existing Android project
- Autentikar credentials and private Maven repository access
- Your application's
applicationIdregistered with Autentikar - A code obtained from the Autentikar
startendpoint
If your applicationId is not registered, contact [email protected].
Permissions
Add the required permissions to AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
Configure the private Maven repository
Add the Autentikar repository to your project repository configuration. The ACCESS_KEY and SECRET_KEY values are provided separately by Autentikar.
allprojects {
repositories {
google()
mavenCentral()
maven {
url "s3://maven.autentikar.s3.amazonaws.com"
credentials(AwsCredentials) {
accessKey ACCESS_KEY
secretKey SECRET_KEY
}
}
}
}
Add the modules
Core is mandatory. Add PhotoIDScan and UnifiedID only when the registered flow uses their steps. Use the current versions listed on each dependency page.
implementation "com.autentikar:core-v2:x.x.x"
implementation "com.autentikar:photoidscan:x.x.x"
implementation "com.autentikar:unifiedid:x.x.x"
Register the flow steps
Register only the contracts required by your flow, normally during application startup:
AutentikarManager.register(
AutentikarPhotoIDScanManager.setContract(AutentikarStepType.CARD_CAPTURE)
)
AutentikarManager.register(
AutentikarUnifiedIDManager.setContract(AutentikarStepType.FACETEC_LIVENESS)
)
AutentikarManager.register(
AutentikarUnifiedIDManager.setContract(AutentikarStepType.FACE_FACETEC)
)
Configure the SDK
Set the alias assigned by Autentikar. Production is the default stage; set it explicitly when you want the configuration to be sandbox.
AutentikarConfiguration.alias = "test"
AutentikarConfiguration.stage = AutentikarStageType.PRODUCTION
The stage selects the service URL used by the SDK.
Start the flow
Pass the launcher, the current Activity, and the code returned when the flow was created:
AutentikarManager.start(
autentikarResultLauncher,
context = this,
code = "j-C5eB0dkVk"
) { error ->
// The SDK could not start. Present or log the error.
}
The result launcher reports whether the SDK lifecycle finished successfully or failed. The start error callback is reserved for failures that prevent the flow from beginning.
Handle the result
Create an Activity Result launcher so the result remains tied to the Activity lifecycle:
RegisterForActivityResult only indicates that the instance has finished its lifecycle; to obtain the result of the instance, use the status endpoint.private val autentikarResultLauncher =
registerForActivityResult(AutentikarResultContract()) { result ->
when (result) {
AutentikarResultType.SUCCESS -> {
println("Success")
}
AutentikarResultType.FAILED -> {
// Handle failure
}
}
}
Customize the experience
All UI-bearing modules can be adapted to your application's branding. Continue with UI customization.
Set up a framework
You can use our native SDK's into your hybrid app using the frameworks availables. However, we recommend the following minimum requirements for framework version.
Core
The Core library allows you to start the flow of the user and allows you to communicate between the modules and the server.