From 78612fd739135336c6ac07c65d90d238f290aadd Mon Sep 17 00:00:00 2001 From: Arnaud Dagnelies Date: Thu, 18 Apr 2024 15:54:12 +0000 Subject: [PATCH] rp.id => domain --- README.md | 20 +++++++++++++++----- demos/example-cdn.html | 2 +- package.json | 2 +- src/client.ts | 8 ++++---- src/server.ts | 5 ++++- src/types.ts | 5 +---- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 6ff9ac5..706d2a6 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ import * as webauthn from '@passwordless-id/webauthn' ```html ``` ### Import @@ -391,6 +391,10 @@ The following options are available for both `register` and `authenticate`. - `'local'`: use the local device (using TouchID, FaceID, Windows Hello or PIN) - `'roaming'`: use a roaming device (security key or connected phone) - `'both'`: prompt the user to choose between local or roaming device. The UI and user interaction in this case is platform specific. +- `domain`: by default, the current domain name is used. Also known as "relying party id". You may want to customize it for ... + - a parent domain to let the credential work on all subdomains + - browser extensions requiring specific IDs instead of domains ? + - specific iframes use cases? - `debug`: If enabled, parses the "data" objects and provide it in a "debug" properties. @@ -400,10 +404,7 @@ Registration options - `discoverable`: (`'discouraged'`, `'preferred'` or `'required'`) If the credential is "discoverable", it can be selected using `authenticate` without providing credential IDs. In that case, a native pop-up will appear for user selection. This may have an impact on the "passkeys" user experience and syncing behavior of the key. *(Default: 'preferred')* - `attestation`: If enabled, the device attestation and clientData will be provided as base64 encoded binary data. Note that this may impact the authenticator information available or the UX depending on the platform. *(Default: false)* - `userHandle`: The user "handle" (also known as user "id") can be used to re-register credentials for an existing user, thus overriding the current credential key pair and username for that `userHandle`. *The default here is based on a hash of the `username`, and thus has some security implications as described in [issue](https://github.com/passwordless-id/webauthn/issues/29).* -- `rp:{id:..., name: ...}`: By default the domain name is used as relying party ID and name. However, there are uses cases where you may want to customize it: - - defining a parent domain to let the credential work on all subdomains - - for browser extensions requiring specific IDs - - for specific iframes use cases? + Authentication options ---------------------- @@ -411,6 +412,15 @@ Authentication options - `mediation`: See https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get#mediation +Verification options +-------------------- + +- `userVerified`: to ensure that the user has been verified by the authenticator +- `counter`: this should be an incrementing value on each authentication, but it was made optional according to https://github.com/passwordless-id/webauthn/issues/38 +- `domain`: in case you used a specific domain (relying party id) during registration/authentication, you need this too during verification +- `verbose`: prints more details to the console if enabled + + Parsing data ------------ diff --git a/demos/example-cdn.html b/demos/example-cdn.html index 5de1fc8..9c311da 100644 --- a/demos/example-cdn.html +++ b/demos/example-cdn.html @@ -10,7 +10,7 @@