Add sendSignal() helper - #778
Merged
Merged
Conversation
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.
This PR adds a new
sendSignal()method to @simplewebauthn/browser to simplify use of the WebAuthn Signal APIs. The WebAuthn Signal APIs are fire-and-forget methods that help Relying Parties (i.e. websites using SimpleWebAuthn for passkeys) try to communicate passkey state changes through the browser and back to an authenticator that may have a passkey for the website. No signal is guaranteed to make it to such an authenticator; WebAuthn Signal API calls (including those made using this newsendSignal()method) are "best effort."Types for the three possible shapes of options that can be passed into this method are also exported. Types include descriptions of each signal and offer advice on when to use them (https://simplewebauthn.dev will get updated shortly after release with new docs for this method as well):
These same
type's are also exported from @simplewebauthn/server to offer RPs typing that can be used when crafting server-side APIs to generate and return these options to pass intosendSignal()in the browser:Examples
PublicKeyCredential.signalUnknownCredential()
PublicKeyCredential.signalAllAcceptedCredentials()
PublicKeyCredential.signalCurrentUserDetails()
Fixes #718.