-
Notifications
You must be signed in to change notification settings - Fork 4
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
Information in the IdentityCredential on output #42
Comments
I think option (D) is the most interesting here, but that might quickly devolve into something too complex to achieve the goals of Lightweight FedCM. Option (A) and (B) both "feel" fine to me. |
I agree with this take. The thing that I think might make D work is that putting the token endpoint URL inside of the argument to get() is possible, since it is fetched after the UI. We may even be able to have it auto-refetch on each collection from the credential store too, which would make it very FedCM-token-like. Whether we do that or just give the same token back that was stored probably is up to the details of the OAuth profile for FedCM. |
Just a couple of comments that may add more clarity here:
Yeah, I tend to agree that (D) seems to be the most "conceptually consistent" option: the "output" of the IdentityCredential is something that gets created "by the IdP". As you noted, In "full FedCM", that's something that gets returned in the Just curious: in "light FedCM", would it be possible to execute a Javascript callback (maybe using service workers?) that the IdP gets to control to generate a message back to the RP? I have no idea if this would be possible, but I think this might be "complex on browser engines" but "light on developers". For reference, Mozilla Persona had a "callback" that the Identity Provider would get here. I'm not sure how that worked, but seems worth looking.
|
Ah, thanks for clarifying. And yes, C was definitely not my favorite choice, I included it for completeness :)
I think that makes it, in practice, less like (d), especially if the implication is that the IdP would call
I think @samuelgoto you've been mentioning the possibility of folding some of the lightweight FedCM design ideas into the main FedCM specification. Is there any reason we can't just make all the fields of the Here's a quick explanation of how this might work for the "user has an account with the IdP and has visited the IdP already" case: User visits the IdP at some point, and it stores that they have an account with the IdP, and any UI hint they also want to provide via Relying party call to .get() from the IdP is done as in the full FedCM specification. let cred = await navigator.credentials.get(
{identity: {providers: {configURL: "https://idp.example/config.json"}); User agent fetches the The {
"id_assertion_endpoint": "/assert",
} Since there's no The user agent displays the account selector using the UI hints stored earlier, the user selects an account, and then the assertion endpoint is called as per the existing FedCM spec. (If a The IdP doesn't even have to implement an assertion endpoint if it doesn't want to. If the only goal is to get a nicer UX than a basic Storage Access prompt, they needn't define anything at all (except maybe a loginUrl for a redirect if the user hasn't visited the IdP on this browser yet.) The This adds a lot more branches to the already complicated FedCM specification, but might well address a wide continuum of usecases and make piecemeal implementation of FedCM integration feasible for IdPs. It also gives a couple knobs for implementations to adjust (some browsers may decide the inconvenience of falling back to the loginURL is acceptable in contrast to the privacy impact of the up-front accounts endpoint call when no pre-stored accounts are available.) |
Yeah, I think that matches my intuition. Just as a concrete example of another variation, here is another case:
They could also choose to implement the {
"accounts_endpoint": "/accounts",
} This tells the browser: pull accounts from the
Yeah, I agree that this can get complex quick, but maybe we don't need to think about every single permutation until we hear from developers that they need a specific one? |
I think it would also be interesting to have the token endpoint provided as an argument to the The accounts endpoint would be useful as well, however it would have to be fetched after an IDP-entry in the credential chooser, to prevent attacks on privacy. |
I think there's value in trying to minimize the amount of divergence between FedCM and Lightweight FedCM here and leverage the existing configuration. What benefit does supplying the config URL in the It's true that if we take it as a given that the user will be picking the IdP from a list before any requests (credential-less or otherwise) are issued, there's probably no harm in doing this. But it seems like supplying this at .store() time is an unnecessary difference.
Agreed, I think this fits together nicely in this model. |
I agree, which is why I would use the fetch description of the Token endpoint from FedCM.
If an IDP wants to provide the token, I don't want to require adopting the site-level well-known resource since it is a challenge for some deployments. This is also why the loginURL is in the |
Just an idea that occurred to me after thinking about this a bit more on (C) ...
So, something that could be very interesting, but may be something that we'd want to layer on top of the other options, is to use a signed SD-JWT and the the Three Party Model with the browser (or a wallet or a password manager) as the holder: have the This would be clearly not retrofittable into the current system, requiring the RP to redeploy, so not a great starting point, but seems like a good long term design: something that allows us a gradual upgrade path from It is not clear to me whether that's a FedCM concern or a Digital Credentials concern and where to draw the line between the two (maybe the former is more "high level" and the latter is more "low level"?), but just wanted to throw it out there as a possible "long term design" that can be built on top of lightweight. |
After w3c-fedid/FedCM#39 is resolved and if w3c-fedid/FedCM#41 is merged, there isn't much left for the RP to do with the IdentityCredential it gets back from
navigator.credentials.get()
. This is a bit of a bummer. After some discussion with @samuelgoto and @johannhof we've identified a couple of possibilities for what the RP could do with this (aside from the implicit Storage-Access grant that is currently assumed by the explainer.)Alternatives presented in order of "simplest" to "most complicated:"
(A) We just accept that the returned IdentityCredential only conveys 1) that the user selected an account and 2) which IdP the user's account selection is from. From there the RP can know which IdP's embedded frame to communicate with to request storage access and work from there.
(B) On output, we populate a dictionary on the IdentityCredential with the UI hint information provided by the IdP at
.store()
time.user's name and profile picture. You can do something useful in a few lines.
(C) On output, we could include a
token
field that contains an unsigned JWT with assertions corresponding to the UI hints that the IdP provided when.store()
was called.garbage seems like a bad idea.
(D) After
get()
is called and the user makes a selection from the account picker, we can optionally proceed with the "get the assertion" part of the full FedCM process.identity insofar as they trust the IdP.
basically indistinguishable.
back to option (A) or (B), but then that creates the same codepath bifurcation problem.
FedCM; identifying what subset would apply here is left as an exercise to the reader.
The text was updated successfully, but these errors were encountered: