Skip to content

Commit d0d5b0f

Browse files
committed
Suggestions for client hints
1 parent bbb98ef commit d0d5b0f

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

  • content/en/docs/advanced/client-hints

content/en/docs/advanced/client-hints/index.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ layout: docs
1010

1111
When creating a passkey, WebAuthn Clients display a credential manager selection screen asking users to choose where to store their new passkey. The selector typically defaults to local credential managers because they offer immediate availability and support for synced passkeys, the default credential type in unmanaged, consumer contexts.
1212

13-
During a sign in flow, the WebAuthn client will do its best to help the user select a passkey which is immediately available, and fall back to an external authenticator selection screen. This typically shows an option for [FIDO Cross-Device Authentication](../reference/terms/#cross-device-authentication-cda) and security keys. In environments where only security keys are allowed, having additional options can confuse users and lead to unnecessary steps.
13+
During a sign in flow, the WebAuthn Client will do its best to help the user select a passkey which is immediately available, and fall back to an external authenticator selection screen. This typically shows an option for [FIDO Cross-Device Authentication](../reference/terms/#cross-device-authentication-cda) and security keys. In environments where only security keys are allowed, having additional options such as displaying a QR code for hybrid flows can confuse users and lead to unnecessary support costs.
1414

15-
The WebAuthn Client Hints feature allows a Relying Party to request a more predictable experience based on their requirements. It is important to note that this is only a hint, and is not used to enforce security policy.
15+
The WebAuthn Client Hints feature allows a Relying Party to request a more predictable experience based on their requirements. It is important to note that this is only a hint, and is not used to enforce security policy. Any requirements around security policy enforcement are the responsibility of the Relying Party and should be factored in to response processing in both the registration and authentication flows.
1616

1717
## Use Cases and Usage
1818

@@ -63,9 +63,10 @@ Simply adapt your existing passkey creation flow to use the hints parameter as s
6363
hints: [ "security-key" ], // this is the WebAuthn Client Hints parameter
6464
authenticatorSelection: {
6565
residentKey: "required",
66-
userVerification: "preferred",
66+
userVerification: "required",
6767
authenticatorAttachment: "cross-platform"
68-
}
68+
},
69+
attestation: "direct"
6970
}
7071
});
7172
// omitted
@@ -106,15 +107,16 @@ Sample code:
106107
hints: [ "security-key" ],
107108
authenticatorSelection: {
108109
residentKey: "required",
109-
userVerification: "preferred",
110+
userVerification: "required",
110111
authenticatorAttachment: "cross-platform"
111-
}
112+
},
113+
attestation: "direct"
112114
}
113115
});
114116
// omitted
115117
};
116118
117-
async function createPasskeyOnLocalDevice() {
119+
async function createPasskeyOnLocalDevice() {
118120
const credential = await navigator.credentials.create({
119121
publicKey: {
120122
challenge: "challenge-from-server",
@@ -127,7 +129,8 @@ Sample code:
127129
residentKey: "required",
128130
userVerification: "preferred",
129131
authenticatorAttachment: "platform"
130-
}
132+
},
133+
attestation: "direct"
131134
}
132135
});
133136
// omitted
@@ -154,7 +157,7 @@ Sample code for scenario 1:
154157
```html
155158
<!-- additional code omitted -->
156159

157-
<button type="button" onclick="signIn()">Sign in with a passkey</button>
160+
<button type="button" onclick="signIn()">Sign in with a passkey using your external security key</button>
158161

159162
<!-- additional code omitted -->
160163

@@ -175,7 +178,7 @@ Sample code for scenario 1:
175178

176179
##### Scenario 2
177180

178-
In scenario 2, an identifier-first flow is used where the user enters their username, and a request is made to the server for a list of credential IDs for the user. These are then passed in to the WebAuthn request (along with their transports) in the `allowCredentials` list. If only passkeys on security keys are included, the WebAuthn Client will show the security key experience.
181+
In scenario 2, an identifier-first flow is used where the user enters their username, and a request is made to the server for a list of credential IDs for the user. These are then passed to the WebAuthn request (along with their transports) in the `allowCredentials` list. If only passkeys on security keys are included, the WebAuthn Client will show the security key experience.
179182

180183
Sample code:
181184

0 commit comments

Comments
 (0)