Re: [webauthn] Deprecate AuthenticatorAttachment in favor of PublicKeyCredentialHints. (#2053)

> No, I was not intentionally ordering the hints in that comment. RP's should be free to order hints as they see fit.

Is this true? The spec says "if two hints are contradictory, the first one controls" which seems to imply that something like `["security-key", "client-device"]` is equivalent to `["security-device"]` due to the two contradicting each other and `"security-key"` appearing first. Additionally the spec states, "Hints may also overlap: if a more-specific hint is defined a [Relying Party](https://www.w3.org/TR/webauthn-3/#relying-party) may still wish to send less specific ones for user-agents that may not recognise the more specific one. In this case the _most specific hint should be sent before the less-specific ones_" (emphasis added). This seems to imply that something like `["hybrid", "security-key"]` is wrong since the latter is more specific and thus "should be sent before".

> `authenticatorAttachment` still has value as a signal of whether the user might need to be prompted to register their local access device. Hints don't control browser behavior in the same way that authenticatorAttachment does; it's possible that specifying `hints: ["security-key"]` leads to the user completing hybrid authentication anyway. What value might be returned for a hypothetical "`PublicKeyCredential.hints`" in the response in this scenario? `["security-key"]` wouldn't make sense, but the RP didn't specify `["hybrid"]` so it could be confusing...meanwhile returning `authenticatorAttachment: "cross-platform"` remains an accurate description of the general type of the authenticator that ultimately completed the ceremony, so I can't see the benefit of replacing `PublicKeyCredential.authenticatorAttachment` right now.

So then I don't understand [your comment](https://github.com/w3c/webauthn/issues/2053#issuecomment-2023382632) that `AuthenticatorAttachement` should be deprecated. You seem to be arguing now that there is use in `AuthenticatorAttachment` that is not filled by `PublicKeyCredentialHints`. Were you stating that it should be deprecated only within `PublicKeyCredentialCreationOptions` but elsewhere (e.g., `PublicKeyCredential` and `PublicKeyCredentialRequestOptions`) still exist?

Additionally nothing in the spec states or implies that the `AuthenticatorAttachement` that is sent as part of `PublicKeyCredential` SHOULD or MUST match the one that was sent in `PublicKeyCredentialCreationOptions`; therefore I don't see why a mismatch would be confusing.

> Mapping in the opposite direction, from `hints` to `authenticatorAttachment`, isn't quite that easy. While `["hybrid", "security-key"]` and `["security-key", "hybrid"]` conveys slightly different desires by the RP about which type of authenticator they want the browser to start the user in. Naively mapping either combination to `"cross-platform"` prunes this desire.

As stated already, the spec seems to indicate that `["hybrid", "security-key"]` shouldn't exist since the former is less specific than the latter. Also the spec _does_ attempt to map from `hints` to `authenticatorAttachment`, but unfortunately is does so in an incomplete way. For example it states `["security-key"]` SHOULD be mapped to `"cross-platform"`, but it doesn't state anything about `["security-key", "hybrid"]`. Additionally as stated in my previous comment, it suggests mapping `["hybrid"]` to `"cross-platform"` despite it appearing to be better to map that to nothing since a lack of `authenticatorAttachment` field means "any attachment modality is acceptable".

> My ultimate goal with hints was to make it possible to break up registration into three separate flows. The introduction of passkeys jammed hybrid registration into previously-security-key-only flows. For RP's (like Duo Security) that want to be able to show the user instructions before the WebAuthn ceremony this made it incredibly difficult to pull this off. Especially when we wanted the user to use their security key but were shown this by their browser:
> 
> ![Screenshot 2024-04-19 at 2 23 23 PM](https://private-user-images.githubusercontent.com/5166470/324121173-f572cd92-676b-459c-8e98-07b40be3ef0d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTM1NjgzNTYsIm5iZiI6MTcxMzU2ODA1NiwicGF0aCI6Ii81MTY2NDcwLzMyNDEyMTE3My1mNTcyY2Q5Mi02NzZiLTQ1OWMtOGU5OC0wN2I0MGJlM2VmMGQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MTlUMjMwNzM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2M5MGUzMGVjZWNlZTc0YTkxOTFiMzc2YTlkNzNiZGUzNmIzZjNlOTg3Zjk1MTgxYTgxM2Y1YzIyOTVlOGY0YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.lCxN95jGelFVf3OcW8bLf0khgT7Ewder4cvwo2nt_dk)
> 
> Hints enable registration to now be three options, as passing in `["security-key"]` can have the browser jump straight to security key interaction when `.create()` is called:
> 
> ![Screenshot 2024-04-19 at 2 23 33 PM](https://private-user-images.githubusercontent.com/5166470/324121300-0adac5d5-14fe-449f-b949-7e99bbfc68e0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTM1NjgzNTYsIm5iZiI6MTcxMzU2ODA1NiwicGF0aCI6Ii81MTY2NDcwLzMyNDEyMTMwMC0wYWRhYzVkNS0xNGZlLTQ0OWYtYjk0OS03ZTk5YmJmYzY4ZTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MTlUMjMwNzM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWVmMzA0M2ZjMzc1YTNiYmIyY2ZmNTVjMGIyNWI2M2NhYjhiMDQxZDc3YWNhYmY5OTI5MmEyOGJjM2E1ODdjMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.lT5MSFa-lX1_DijtRWYUM07UBmNsIjOlgLQ2Lj75n_8)
> 
> Sure, clients are free to allow the user to choose a different kind of authenticator than specified in the hint, but if users are just looking to click Next to get through the first thing shown to them this doesn't seem too bad a restriction over using `authenticatorAttachment`.

Thanks for the explanation. I understand the intent of `PublicKeyCredentialHints` a little better now; however to @timcappalli's point, there seems to be use cases for `AuthenticatorAttachement` (which you seem to agree based on your response). Additionally there seems to be missing/contradictory information in the spec as it relates to `PublicKeyCredentialHints` and `AuthenticatorAttachment`.

-- 
GitHub Notification of comment by zacknewman
Please view or discuss this issue at https://github.com/w3c/webauthn/issues/2053#issuecomment-2067393913 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 19 April 2024 23:35:29 UTC