Skip to content

feat(Extensions): Add prf extension interfaces #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

tarekbeb
Copy link

@tarekbeb tarekbeb commented May 1, 2025

This pull request introduces new interfaces and properties to support the PRF (Pseudorandom Function) extension in WebAuthn authentication flows. It adds:

  • AuthenticationExtensionsPRFValues
  • AuthenticationExtensionsPRFInputs
  • AuthenticationExtensionsPRFOutputs
  • Updated AuthenticationExtensionsClientInputs and AuthenticationExtensionsClientOutputs with the prf inputs and outputs respectively.

How to use:

const pubKeyCredential: PublicKeyCredential = credential;
const clientExtensions = credential.getClientExtensionResults()
const isPrfEnabled = clientExtensions.prf?.enabled
const prfValue = new Uint8Array(extensions.prf.results?.first);

Once the prf value is obtained, a CryptoKey can be derived to be used in the browser to encrypt/decrypt data. (https://blog.millerti.me/2023/01/22/encrypting-data-in-the-browser-using-webauthn/)

PRF Specification:
https://www.w3.org/TR/webauthn-3/#prf-extension

@tarekbeb tarekbeb marked this pull request as draft May 1, 2025 18:54
@MasterKale
Copy link
Owner

Hello @tarekbeb as per the README this project is not open to external PRs. I am more than happy to continue this conversation over in the issue you created, though (thank you for that 🙏)

@MasterKale MasterKale closed this May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants