-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow IdPs to return JSON objects rather than Strings back to RPs #13
Comments
hmm that introduces an asymmetry between the JS version and returning a token directly from the token endpoint. I'm also not sure if there's much value in introducing the equivalent of a JSON serialize/parse in the browser side instead of the JS side? |
I just encountered another situation where it would make sense to return additional data besides the single |
As I started implementing FedCM into Rauthy today as well, I came across the same issue. Maybe the FedCM could simply return the whole body as it is to the RP? The current implementation is static and both parties must agree on a behavior upfront, out of band. When the FedCM would return the body as it is, the RP could deserialize it and dynamically know which protocol or type of auth would work with the IdP. It would also allow all different kinds of login flows, be it Implicit (which would be safe again, if the response would be inside the body instead of URL), authorization code, be it OAuth2 or OIDC, or other specs like IndieAuth. The RP could deserialize the response and simply check in which scheme it fits. Edit: Just another thought on this to make it even more dynamic and maybe easier for simpler IdP's to implement it: |
Another option that occurred in the call by @aaronpk is to have the |
I think I had actually originally prototyped it that way, but switched to this version where |
Ok, so here is one proposal to make this a bit more concrete, since this is coming up in a series of discussions:
For example: dictionary IdentityProviderAssertion {
optional USVString token;
optional object data;
}; And then: interface IdentityCredential : Credential {
readonly attribute USVString? token;
readonly attribute object? data;
}; In use, this is what it would look like in an {
"data" : {
"this_is_a_json": true,
"really": true,
"i_cant_believe_it": {
"believe_me": ["for real"]
}
}
} Which would then lead to a JS object returned by the JS API: const {data: {really}} = await navigator.credentials.get({
// typical call
});
// really == true |
We probably want |
IdPs can currently return a token which is a
USVString
through the id assertion endpoint, which, in theory, can actually also contain JSON viaJSON.stringify(data)
.w3c-fedid/FedCM#572 (comment) suggests that it would be easier for IdPs if they could actually return an
object
as opposed to a JSON-serializedUSVString
, which I think can have its merits.The text was updated successfully, but these errors were encountered: