
Unified biometric and PIN authentication API with availability checks and detailed results, pluggable PIN hashing/storage, multiple platform biometric backends, and a responsive authentication UI.
Authentication and biometric support for Kotlin Multiplatform.
fprintd on Linux JVM.| Artifact | Description | Targets |
|---|---|---|
biometric |
Common biometric API and platform implementations | JVM, Android, macOS ARM64, mingwX64 |
auth |
PIN storage, hashing, and combined PIN/biometric authentication | JVM, Android |
auth-compose |
Compose Multiplatform authentication screen | JVM, Android |
Choose the highest-level module that your application needs. auth-compose exposes auth, and auth exposes biometric.
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.ucasoft.koncierge:biometric:0.2.0")
// Or:
// implementation("com.ucasoft.koncierge:auth:0.2.0")
// implementation("com.ucasoft.koncierge:auth-compose:0.2.0")
}
}
}On JVM, macOS ARM64, and mingwX64:
val koncierge = Koncierge()On Android, pass a FragmentActivity as the context:
val koncierge = Koncierge(activity)Create the platform instance at the application boundary and pass it to common code.
when (val result = koncierge.authenticate("Confirm your identity")) {
BiometricResults.AuthenticationSuccessful -> {
// Continue to protected content.
}
BiometricResults.AuthenticationCancelled -> {
// The request was cancelled.
}
else -> {
// Handle unavailable hardware, missing enrollment, lockout, or failure.
}
}Use koncierge.isBiometricAvailable() when you only need an availability check.
val authenticator = Authenticator(koncierge)
authenticator.storePinCode("1234")
if (authenticator.verifyPinCode("1234")) {
// PIN verified.
}By default, Authenticator hashes the PIN with SHA-256 and stores the result with Multiplatform Settings. Implement PinCodeHashProvider or PinCodeStoreProvider to use hashing and storage appropriate for your application's security requirements.
@Composable
fun LoginScreen(
authenticator: Authenticator,
onAuthorized: () -> Unit,
) {
AuthScreen(
authenticator = authenticator,
title = { Text("Koncierge") },
description = { Text("Authenticate to continue") },
onAuthorizationFailed = { method ->
// Handle a failed PIN or biometric attempt.
},
onAuthorized = onAuthorized,
)
}Biometric authentication is requested automatically when it is available. Set autoRequestBiometry = false to wait for the user to tap the biometric button.
FragmentActivity to Koncierge.fprintd-list and fprintd-verify on PATH, with a fingerprint already enrolled.Koncierge is currently at version 0.2.0 and is under active development.
Koncierge is licensed under the Apache License 2.0.
Authentication and biometric support for Kotlin Multiplatform.
fprintd on Linux JVM.| Artifact | Description | Targets |
|---|---|---|
biometric |
Common biometric API and platform implementations | JVM, Android, macOS ARM64, mingwX64 |
auth |
PIN storage, hashing, and combined PIN/biometric authentication | JVM, Android |
auth-compose |
Compose Multiplatform authentication screen | JVM, Android |
Choose the highest-level module that your application needs. auth-compose exposes auth, and auth exposes biometric.
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.ucasoft.koncierge:biometric:0.2.0")
// Or:
// implementation("com.ucasoft.koncierge:auth:0.2.0")
// implementation("com.ucasoft.koncierge:auth-compose:0.2.0")
}
}
}On JVM, macOS ARM64, and mingwX64:
val koncierge = Koncierge()On Android, pass a FragmentActivity as the context:
val koncierge = Koncierge(activity)Create the platform instance at the application boundary and pass it to common code.
when (val result = koncierge.authenticate("Confirm your identity")) {
BiometricResults.AuthenticationSuccessful -> {
// Continue to protected content.
}
BiometricResults.AuthenticationCancelled -> {
// The request was cancelled.
}
else -> {
// Handle unavailable hardware, missing enrollment, lockout, or failure.
}
}Use koncierge.isBiometricAvailable() when you only need an availability check.
val authenticator = Authenticator(koncierge)
authenticator.storePinCode("1234")
if (authenticator.verifyPinCode("1234")) {
// PIN verified.
}By default, Authenticator hashes the PIN with SHA-256 and stores the result with Multiplatform Settings. Implement PinCodeHashProvider or PinCodeStoreProvider to use hashing and storage appropriate for your application's security requirements.
@Composable
fun LoginScreen(
authenticator: Authenticator,
onAuthorized: () -> Unit,
) {
AuthScreen(
authenticator = authenticator,
title = { Text("Koncierge") },
description = { Text("Authenticate to continue") },
onAuthorizationFailed = { method ->
// Handle a failed PIN or biometric attempt.
},
onAuthorized = onAuthorized,
)
}Biometric authentication is requested automatically when it is available. Set autoRequestBiometry = false to wait for the user to tap the biometric button.
FragmentActivity to Koncierge.fprintd-list and fprintd-verify on PATH, with a fingerprint already enrolled.Koncierge is currently at version 0.2.0 and is under active development.
Koncierge is licensed under the Apache License 2.0.