-
Notifications
You must be signed in to change notification settings - Fork 39
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
Disallow multiple types via navigator.credentials's methods #244
Comments
I'll note that .create() already forbids the above (it's restricted to 1 know type). |
PasswordCredential & FederatedCredential types are both accepted by We (meaning, the broader web authentication & identity teams at Chrome) want multiple credential types on the same request to work more broadly eventually. We designed FedCM and WebAuthn as part of CredMan with the aspirations that one day we'll unify the UI in an integrated sign-in experience. It's true this is not the case right now for every combination of providers. However, I would prefer not to restrict this on the specification. |
Ok, I see... it does a joint UI as per this article.
Right, there may definitely valid combinations, but it's also the case where we end up with invalid combinations (e.g., say, Web Authn and Digital Credentials and Passwords). Would it make sense to only allow individual and well-established/standardized combinations? (e.g., |
The only combination that immediately strikes me as invalid is digital credentials and anything else, due to the very flexible nature of digital credential assertions, potentially allowing for very strong identification. I thought isolating access to digital credentials under the |
You are correct about isolating access to digital credentials under the If we consolidate everything in Also, we kinda don't want to use "identity" anymore, as the API is now generally about "digital credentials" (took us a couple of false starts to get here... naming things is hard). |
Okay, consolidating everything under What if the spec is updated so that |
I still really am not sure about making DigitalCredentials available on the same API surface as the rest of the Credential types, particularly because of the differences Nina pointed out here. Putting distance between auth and digital credentials for developers is a positive IMO. |
Right, but the "distance" is cosmetic. Implementation-wise (and yes, priority of constituents comes into play), it's making things messy having the artificial distance just be I'm also thinking about this from a Web Developer's perspective: having a single entry point for getting to credentials doesn't strike me as negative.
Note that I'm in agreement with Nina also about differences. But irrespective of Digital Credentials, leaving the combinations open ended is not good practice from in interop perspective. It's also not how things have played out in practice with how engines have implemented Cred Man. I'm ok to sit on this for a bit and we can discuss it a bit more. But as I'm implemented in more and more of the spec in WebKit (and seeing the overlap with Web Auth), I'm starting the feel more and more we should really have a single entry point ( @samuelgoto, can you share your experience from the Chromium side? |
That would work for me, yes. |
I tend to agree with your suggestion @marcoscaceres but that's not a hill I'm willing to die on: I agree that the distinction between Based on what I'm hearing from developers, I'm convinced that I don't mind crossing that bridge when we get there, so don't mind exposing So, to sum up, my personal preference is to use |
That would be not great. We should say not to do that and provide guidance in the appropriate place (outside the scope of this discussion though). But it does frame some motivating factor here. I still think we need to take a step back here, as this is larger than all the aforementioned specs. The fundamental issue that remains unaddressed is:
And
What happens leads to all sorts of custom handling for each entry point and a bunch of undefined behavior. For example, in WebKit, I'm already having to deal with the interplay of these (which is not in the spec): Same here in Credential Container: if (options.publicKey && options.digital) {
promise.reject(Exception { ExceptionCode::NotSupportedError, "Only one request type is supported at a time."_s });
return false;
} So you can see we are already having code those checks into the implementation. There's potential interop pitfalls here which I we should deal with. Also, take a look at Gecko's code for Gecko checks the What does Chrome do here? |
Oh! in Gecko, Anyway, I hope you see my point now. This is not good and could be quite confusing from a developer (and implementer) perspective:
We should fix this. It's easy to fix and it would obliterate the need for |
Oh, and I think I found another issue: What happens if multiple credential types are allowed per request, but they have conflicting mediation requirements? |
The first thing that occurs to me is that we should start by throwing |
Right, which is what WebKit already does (but, for instance, Gecko doesn't). The ask here is that we standardize the behavior, as it's not specified. Otherwise we will end up with subtly different behavior (we evidently already have, as I showed above). That's a problem, IMO. And the longer we leave it, the more deviation there will be and we risk ending up with the usual site compat issues and developer relying on one browser's non-standard behavior. Let's nip this in the bud now before we see wide adoption of DC, FedCM, and whatever future API might come to rely on Cred Man. They will have this exact same problem too, exponentially so if we stick to delineating things on |
LGTM What's the next step here? Would a (backwards compatible) spec PR to the CredMan API suffice to throw |
Discussed with @samuelgoto. We could add a column to registry that says something like, can be used with "other-credential"(s). We noted that Gecko makes Web Authn win (and other things get ignored). |
A few questions that occurred to @marcoscaceres and I as we were chatting about this as we were trying to figure out what algorithm to suggest in the spec:
|
We met and discussed:
|
Moving discussion from WICG/digital-credentials#140 to here....
As spec'ed, the current API allows calling the methods on
CredentialsContainer
with multiple request types. However, in practice, this doesn't quite work because some of the methods show quite complicated UIs. Additionally, as this capability is not something that's been implemented by anyone (AFAIK), we should consider not allowing that.Thus, the proposal is to check if more than one credential request (and creation?) option has been passed, and if so, throw a
NotAllowedError
.To be clear:
cc @bvandersloot-mozilla, @samuelgoto, @nsatragno
The text was updated successfully, but these errors were encountered: