JsWebAuthnProvider

constructor(rpId: String, rpName: String, timeout: Long = OZConstants.WEBAUTHN_TIMEOUT_MS)

Parameters

rpId

Relying party identifier (typically the origin domain, e.g. "example.com")

rpName

Human-readable relying party name displayed to the user during ceremonies

timeout

Timeout in milliseconds for WebAuthn operations (default: 60000ms)

Example usage:

val provider = JsWebAuthnProvider(
rpId = "example.com",
rpName = "My Stellar App"
)

// Register a new passkey
val registration = provider.register(
challenge = challengeBytes,
userId = userIdBytes,
userName = "alice@example.com"
)
println("Credential ID: ${registration.credentialId.size} bytes")
println("Public key: ${registration.publicKey.size} bytes")

// Authenticate with the passkey
val authentication = provider.authenticate(challenge = payloadHash)
println("Signature: ${authentication.signature.size} bytes")