Skip to main content

Module credentials

Module credentials 

Source
Expand description

WebAuthn virtual-authenticator credentials.

Obtained via BrowserContext::credentials. Install a virtual authenticator, then register / list / delete passkeys programmatically to drive navigator.credentials.create()/get() ceremonies in tests without real hardware.

let creds = context.credentials();
creds.install().await?;
let cred = creds.create("example.com", None).await?;
assert_eq!(creds.get(None).await?.len(), 1);
creds.delete(&cred.id).await?;

See: https://playwright.dev/docs/api/class-credentials

Structs§

Credentials
Manages the browser context’s virtual WebAuthn authenticator.
CredentialsCreateOptions
Optional fields for Credentials::create. When omitted, the authenticator generates them.
CredentialsGetOptions
Filters for Credentials::get. With no filter set, all credentials are returned.
VirtualCredential
A virtual WebAuthn credential (passkey) held by the virtual authenticator.