Js Web Authn Provider
Parameters
rp Id
Relying party identifier (typically the origin domain, e.g. "example.com")
rp Name
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")Content copied to clipboard