TestOptions

Builds server-style WebAuthn options JSON for tests. Defaults come from a secure random source, safe under concurrency.

Functions

Link copied to clipboard
fun creation(rpId: String, challenge: String = randomBase64Url(32), userId: String = randomBase64Url(16), userName: String = "alice@example.com", displayName: String = "Alice", excludeCredentialIds: List<String> = emptyList()): String

PublicKeyCredentialCreationOptionsJSON for rpId, requesting a discoverable ES256/RS256 credential. challenge and userId are base64url; the defaults are random (32 and 16 bytes).

Link copied to clipboard
fun request(rpId: String, challenge: String = randomBase64Url(32), allowCredentialIds: List<String> = emptyList()): String

PublicKeyCredentialRequestOptionsJSON for rpId. challenge is base64url (random 32 bytes by default); an empty allowCredentialIds means any discoverable credential.