feat(credentials): add context.credentials WebAuthn virtual authenticator#40849
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0a1245b to
f3f162d
Compare
yury-s
approved these changes
May 14, 2026
| - `id` <[string]> Base64url-encoded credential id. | ||
| - `rpId` <[string]> Relying party id. | ||
| - `userHandle` <[string]> Base64url-encoded user handle. | ||
| - `privateKey` <[string]> PKCS#8 PEM-encoded private key. |
| * since: v1.61 | ||
| - returns: <[Object]> | ||
| * alias: VirtualCredential | ||
| - `id` <[string]> Base64url-encoded credential id. |
Member
There was a problem hiding this comment.
should playwright encode it itself?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f3f162d to
e332ff3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e332ff3 to
f32c5b5
Compare
…ator
Adds a flat namespace on BrowserContext that intercepts the page's
navigator.credentials.create() / .get() calls and answers them with an
ES256 keypair Playwright owns. Implemented in userland via an injected
script + a binding, so it works on Chromium, Firefox and WebKit with no
per-browser code.
const context = await browser.newContext({ credentials: true });
await context.credentials.create({ rpId: 'example.com' });
// page's navigator.credentials.get() now succeeds silently.
Verbs mirror navigator.credentials; no authenticator entity. Server-side
registry handles keypair generation, CBOR/COSE encoding of attestation
objects, and ECDSA signing of assertions. Pass id/userHandle/privateKey/
publicKey together to import a pre-registered credential.
Fixes: microsoft#7276
f32c5b5 to
8c5fe9e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Test results for "MCP"7099 passed, 1104 skipped Merge workflow run. |
Contributor
Test results for "tests 1"4 flaky41952 passed, 850 skipped Merge workflow run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BrowserContext.credentials— a flat, web-API-shaped namespace for seeding WebAuthn credentials and interceptingnavigator.credentials.create/getceremonies.Fixes #7276