Web Authn Provider
interface WebAuthnProvider
Platform-specific WebAuthn provider interface.
This interface defines the contract for WebAuthn operations across different platforms (JVM, JS browser, iOS, Android). Each platform provides its own implementation using expect/actual declarations.
Implementations must:
Trigger platform-specific biometric/security key prompts
Handle WebAuthn credential creation and assertion
Return properly formatted results with raw byte arrays
Example implementation pattern (expect/actual):
// commonMain
expect class WebAuthnProviderImpl : WebAuthnProvider
// jsMain (browser)
actual class WebAuthnProviderImpl : WebAuthnProvider {
actual suspend fun register(...) { ... navigator.credentials.create ... }
actual suspend fun authenticate(...) { ... navigator.credentials.get ... }
}
// jvmMain
actual class WebAuthnProviderImpl : WebAuthnProvider {
// Placeholder implementation or integration with Java WebAuthn library
}Content copied to clipboard
Usage:
val config = OZSmartAccountConfig(
...
webauthnProvider = WebAuthnProviderImpl()
)Content copied to clipboard
Inheritors
AndroidWebAuthnProvider
JsWebAuthnProvider
AppleWebAuthnProvider
Functions
Link copied to clipboard
abstract suspend fun authenticate(challenge: ByteArray, allowCredentials: List<AllowCredential>? = null): WebAuthnAuthenticationResult
Authenticates with an existing WebAuthn credential (passkey assertion).