# Federated Credentials API: Developer feedback needed

**URL:** <https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961>\
**Category:** Fediversity\
**Created:** [February 29, 2024, 8:05am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961 "2024-02-29T08:05:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aschrijver](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/aschrijver/32/278_2.png) [@aschrijver](https://socialhub.activitypub.rocks/u/aschrijver)\
**Post date:** [February 29, 2024, 8:05am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/1 "2024-02-29T08:05:43Z")

</div>

![Dialog snapshot showing "Login with Facebook" and "Login with Google" buttons and a text balloon saying "But where is My Choice?".](https://blog.foad.me.uk/wp-content/uploads/2024/02/fedcm-my-choice-1.png)

_Image created by Julian Foad, @julianfoad._

The [W3C Federated Identity CG](https://www.w3.org/community/fed-id/) is working on [Federated Credential Management](https://fedidcg.github.io/FedCM/) Web Platform API specification. One of the issues is that the authors may focus mostly on Big Tech identity providers. So folks working to use Solid wrote an article, and there’s a Github issue to allow IDP registration, give any provider a chance in this mechanism. Julian Foad summarized all that in another article [FedCM: Sign-In-With-Big-Tech-Only or Sign-In-With-Whom-I-Prefer?](https://wrily.foad.me.uk/sign-in-with-big-tech-only-or-sign-in-with-whom-i-prefer).

The Community Group is seeking developer feedback, so if any of you are working/interested in the subject, either from Fediverse or other background, then participate on the GH issue, or alternatively [respond on the fedi](https://w3c.social/@goto/112010790612644936) to Sam Goto of the Google Chrome team.

Here is a direct link to the Github issue:

> <https://github.com/fedidcg/FedCM/issues/240>
>
> TL;DR there is a significant amount of context at the start of this issue before… we get to the proposal, here is a \[google doc version\](https://docs.google.com/document/d/1zxRFhF6qwGTCOYZ6UwTutbXVyRiD3krXyfFkcp\_6t98/edit) for an alternative form.
> 
> \# Background
> 
> The origins of many federated identity technologies have deep ties to providing an open ecosystem of IDPs to give End Users ample choice in how they choose to “login”. Efforts like OpenID v1 and v2, SIOP, Mozilla Persona, CHAPI, and others, strongly embodied these principles and much of this has remained in future revisions of standards such as OpenID Connect core. However, due to numerous complex issues, much of the industry today, primarily around the “social login” market has consolidated leaving a few IDPs as the dominant market players. To counteract this, FedCM in this work on establishing new browser mechanisms for supporting federated identity has an opportunity to make a meaningful impact and help re-chart the course for the future of federated identity on the web.
> 
> In the landscape of today, the choices around federated providers an End-User has available to them when going to “login” on the web is most often a small curated list of IDPs pre-determined by the Relying Party. 
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160963891-b2531e42-c847-4eb9-ad9d-2351f732836a.png)
> 
> One of the main market forces that influences the options an End-User is presented with is often referred to as the NASCAR problem (https://github.com/fedidcg/FedCM/blob/main/explorations/related\_problems.md#the-nascar-flag-problem). In order for a relying party to keep the UX on their login page from being overwhelming, they must pick a small number of IDPs to support (usually 2-3). How this decision is made by a relying party can be complex, but one major driving factor that applies to many is the existing user-base a particular IDP offers. Often the larger the user base, the more likely the relying party is in its desire to support it. This is because the relying party wants to offer as few login options as possible that services the largest possible user-base for them. This factor makes it difficult for new competition in the IDP side of the federated identity landscape, especially for entities that don’t have large pre-existing user-bases.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160963995-d8c0273c-4b7a-4814-8bbb-fe9bb90a1643.png)
> 
> Who an IDP is, is often also important to factor in. As federated login technologies have developed, companies who built successful social networks, ISPs and commonly used search engines had the large user bases that made them attractive as IDPs to many Relying Parties. These IDPs have been very open about their interests in performing the IDP role, where the access it gives them to information about End User behavior, often supports their primary business models. In this context, concerns about user tracking are very real.
> 
> End Users looking to opt out of the limited federated identity login options available today are required to significantly compromise convenience because they are forced to manage a new set of credentials directly with the relying party, creating friction and usability challenges. 
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964047-69b7c170-28e9-4180-acde-7bbed658f5b5.png)
> 
> This equation in many cases has led to End Users using federated login options, trading off concerns such as the fear of being tracked by a particular IDP, for the convenience it offers. As a result, Relying Parties seeking large user bases continue to converge on the dominant IDPs and End User choice is further diminished. We end where we are today, in a self-reinforcing loop dominated by extremely limited choice at logon.
> 
> What we need to support instead is a federated login model that re-introduces the End-User into the mediation process so they can have more of a say on which provider they use and where.
> 
> \# Proposal
> 
> Currently the proposed FedCM API is focused around a browser mediated approach that assumes the relying party specifies a set of IDPs it supports login from. This model is largely a continuation of that described above and in many respects is just a browser mediated version of what we see most commonly on the web today.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964115-0eca6bf6-cd24-45b1-9d89-ac37338ad973.png)
> 
> Many Relying Parties will want to continue in a model where they specify the IDPs they support.
> 
> \*\*The challenge is for when this is not the case, to provide a viable way to achieve more End-User choice, greater inclusiveness, increased competition, and reduce vendor lock-in around the IDP options available.\*\*
> 
> In this proposed additional model, instead of the Relying Party specifying the IDPs it supports in the federation request, it communicates the capabilities it supports such as signature schemes, assertion formats and response modes. 
> 
> End-Users can then register providers they wish to use with the browser, which are then available as options to present to the End-User when they go to login. This is enabled through the following two step process
> 
> 1) Registration Step - The End User navigates to the IDP they want to use, prior to attempting a login with an RP and registers it for use in the browser.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964201-e2d81fc1-7030-466e-b19b-3c109f30de73.png)
> 
> 2) Login Step - Later when the End User goes to login with a particular RP that supports this open IDP model, instead of the End User being presented with a pre-set list of IDPs determined by the RP, they are presented with a list of IDPs they have registered to use that support the capabilities required by the relying party.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964310-84f0c917-ee75-4da6-ac93-d8d94cb137d8.png)
> 
> \*\*Note\*\* - To prevent a scenario where a relying party is supporting this login model but no IDPs have been previously registered in the browser, the relying party could provide IDP hints.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964237-2c9c7146-907e-4947-9ccc-2c287fc667af.png)
> 
> \# Conclusions
> 
> Considering the cited basis for FedCM is to “preserve and elevate identity federation” please strongly consider adopting this in your work. Choosing this path would have a meaningful positive impact on federated identity on the web by improving the choices End-Users have to login on with. Ignoring this issue risks the continued consolidation of options available for End-Users and therefore undermining its value as a means of login.
> 
> \# Acknowledged Challenges
> 
> \- What happens to an end user when their registrations are wiped?
> \- What happens if an end user has forgotten what IDP they use where?
> \- Can a significant enough portion of relying parties trust login assertions from an IDP for which they don’t have a pre-existing trust relationship?
> \- How are the capabilities supported by the RP communicated to the browser
> 
> \# Prior Art
> 
> \[CHAPI\](https://w3c-ccg.github.io/credential-handler-api/)
> \[Mozilla Persona\](https://wiki.mozilla.org/Identity/Persona\_AAR)
> \[Account Chooser\](https://github.com/openid/accountchooser.com)
> \[OpenID\](https://openid.net/specs/openid-connect-core-1\_0.html)
> 
> Raised with @dmitrizagidulin

---

<div class="post-metadata">

**Author:** ![aschrijver](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/aschrijver/32/278_2.png) [@aschrijver](https://socialhub.activitypub.rocks/u/aschrijver)\
**Post date:** [March 22, 2024, 6:53pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/2 "2024-03-22T18:53:34Z")

</div>

@erlend_sh had some really nice follow-up news wrt this topic today:

> **[Erlend Sogge Heggen (@erlend@writing.exchange)](https://writing.exchange/@erlend/112139095408962633)**
>
> @smallcircles@social.coop @julian@fed.foad.me.uk the author of the #RustLang OIDC library Rauthy will accept a PR for FedCM if someone can give it a go 💫
> 
> https://github.com/sebadob/rauthy/discussions/145#discussioncomment-8831943

Boosts of that post as well as interaction in the various GH discussion/issues most welcome. 🤗

---

<div class="post-metadata">

**Author:** ![erlend\_sh](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/erlend_sh/32/1876_2.png) [@erlend\_sh](https://socialhub.activitypub.rocks/u/erlend_sh)\
**Post date:** [May 19, 2024, 3:25pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/3 "2024-05-19T15:25:03Z")

</div>

Ruby dev needed for FedCM plugin:

> **[Erlend Sogge Heggen (@erlend@writing.exchange)](https://writing.exchange/@erlend/112468343351654051)**
>
> Any #ruby dev out there willing to do a simple plugin for #discourse?
> 
> A handful of indie devs are pitching in with working examples of FedCM, an important new identity standard with direct implications for the #fediverse:...

Related: [Autonomous identity for the pluriverse based on OAuth/OIDC](https://socialhub.activitypub.rocks/t/autonomous-identity-for-the-pluriverse-based-on-oauth-oidc/3675)

@pmusaraj @angus greatly appreciated if you can ask around a bit in your circles 🙏

---

<div class="post-metadata">

**Author:** ![angus](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/angus/32/2295_2.png) [@angus](https://socialhub.activitypub.rocks/u/angus)\
**Post date:** [May 19, 2024, 4:32pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/4 "2024-05-19T16:32:14Z")

</div>

I’ve had a brief read and I think I understand the need. I’ll give it a quick shot next week and let you know.

---

<div class="post-metadata">

**Author:** ![apitman](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/apitman/32/2518_2.png) [@apitman](https://socialhub.activitypub.rocks/u/apitman)\
**Post date:** [May 19, 2024, 11:56pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/5 "2024-05-19T23:56:46Z")

</div>

@angus awesome, thank you! After playing with FedCM this past week I think it has a ton of potential. Having a plugin that would allow any Discourse admin to enable their users to help in testing out FedCM would be huge. The API surface for FedCM itself is quite simple. I suspect most of the work for a plugin will be interacting with Discourse’s sessions.

Here’s a couple resources I’ve found most helpful:

Up-to-date instructions for trying out FedCM:

> <https://github.com/fedidcg/FedCM/issues/240#issuecomment-2004650817>
>
> TL;DR there is a significant amount of context at the start of this issue before… we get to the proposal, here is a \[google doc version\](https://docs.google.com/document/d/1zxRFhF6qwGTCOYZ6UwTutbXVyRiD3krXyfFkcp\_6t98/edit) for an alternative form.
> 
> \# Background
> 
> The origins of many federated identity technologies have deep ties to providing an open ecosystem of IDPs to give End Users ample choice in how they choose to “login”. Efforts like OpenID v1 and v2, SIOP, Mozilla Persona, CHAPI, and others, strongly embodied these principles and much of this has remained in future revisions of standards such as OpenID Connect core. However, due to numerous complex issues, much of the industry today, primarily around the “social login” market has consolidated leaving a few IDPs as the dominant market players. To counteract this, FedCM in this work on establishing new browser mechanisms for supporting federated identity has an opportunity to make a meaningful impact and help re-chart the course for the future of federated identity on the web.
> 
> In the landscape of today, the choices around federated providers an End-User has available to them when going to “login” on the web is most often a small curated list of IDPs pre-determined by the Relying Party. 
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160963891-b2531e42-c847-4eb9-ad9d-2351f732836a.png)
> 
> One of the main market forces that influences the options an End-User is presented with is often referred to as the NASCAR problem (https://github.com/fedidcg/FedCM/blob/main/explorations/related\_problems.md#the-nascar-flag-problem). In order for a relying party to keep the UX on their login page from being overwhelming, they must pick a small number of IDPs to support (usually 2-3). How this decision is made by a relying party can be complex, but one major driving factor that applies to many is the existing user-base a particular IDP offers. Often the larger the user base, the more likely the relying party is in its desire to support it. This is because the relying party wants to offer as few login options as possible that services the largest possible user-base for them. This factor makes it difficult for new competition in the IDP side of the federated identity landscape, especially for entities that don’t have large pre-existing user-bases.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160963995-d8c0273c-4b7a-4814-8bbb-fe9bb90a1643.png)
> 
> Who an IDP is, is often also important to factor in. As federated login technologies have developed, companies who built successful social networks, ISPs and commonly used search engines had the large user bases that made them attractive as IDPs to many Relying Parties. These IDPs have been very open about their interests in performing the IDP role, where the access it gives them to information about End User behavior, often supports their primary business models. In this context, concerns about user tracking are very real.
> 
> End Users looking to opt out of the limited federated identity login options available today are required to significantly compromise convenience because they are forced to manage a new set of credentials directly with the relying party, creating friction and usability challenges. 
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964047-69b7c170-28e9-4180-acde-7bbed658f5b5.png)
> 
> This equation in many cases has led to End Users using federated login options, trading off concerns such as the fear of being tracked by a particular IDP, for the convenience it offers. As a result, Relying Parties seeking large user bases continue to converge on the dominant IDPs and End User choice is further diminished. We end where we are today, in a self-reinforcing loop dominated by extremely limited choice at logon.
> 
> What we need to support instead is a federated login model that re-introduces the End-User into the mediation process so they can have more of a say on which provider they use and where.
> 
> \# Proposal
> 
> Currently the proposed FedCM API is focused around a browser mediated approach that assumes the relying party specifies a set of IDPs it supports login from. This model is largely a continuation of that described above and in many respects is just a browser mediated version of what we see most commonly on the web today.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964115-0eca6bf6-cd24-45b1-9d89-ac37338ad973.png)
> 
> Many Relying Parties will want to continue in a model where they specify the IDPs they support.
> 
> \*\*The challenge is for when this is not the case, to provide a viable way to achieve more End-User choice, greater inclusiveness, increased competition, and reduce vendor lock-in around the IDP options available.\*\*
> 
> In this proposed additional model, instead of the Relying Party specifying the IDPs it supports in the federation request, it communicates the capabilities it supports such as signature schemes, assertion formats and response modes. 
> 
> End-Users can then register providers they wish to use with the browser, which are then available as options to present to the End-User when they go to login. This is enabled through the following two step process
> 
> 1) Registration Step - The End User navigates to the IDP they want to use, prior to attempting a login with an RP and registers it for use in the browser.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964201-e2d81fc1-7030-466e-b19b-3c109f30de73.png)
> 
> 2) Login Step - Later when the End User goes to login with a particular RP that supports this open IDP model, instead of the End User being presented with a pre-set list of IDPs determined by the RP, they are presented with a list of IDPs they have registered to use that support the capabilities required by the relying party.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964310-84f0c917-ee75-4da6-ac93-d8d94cb137d8.png)
> 
> \*\*Note\*\* - To prevent a scenario where a relying party is supporting this login model but no IDPs have been previously registered in the browser, the relying party could provide IDP hints.
> 
> !\[image\](https://user-images.githubusercontent.com/15972525/160964237-2c9c7146-907e-4947-9ccc-2c287fc667af.png)
> 
> \# Conclusions
> 
> Considering the cited basis for FedCM is to “preserve and elevate identity federation” please strongly consider adopting this in your work. Choosing this path would have a meaningful positive impact on federated identity on the web by improving the choices End-Users have to login on with. Ignoring this issue risks the continued consolidation of options available for End-Users and therefore undermining its value as a means of login.
> 
> \# Acknowledged Challenges
> 
> \- What happens to an end user when their registrations are wiped?
> \- What happens if an end user has forgotten what IDP they use where?
> \- Can a significant enough portion of relying parties trust login assertions from an IDP for which they don’t have a pre-existing trust relationship?
> \- How are the capabilities supported by the RP communicated to the browser
> 
> \# Prior Art
> 
> \[CHAPI\](https://w3c-ccg.github.io/credential-handler-api/)
> \[Mozilla Persona\](https://wiki.mozilla.org/Identity/Persona\_AAR)
> \[Account Chooser\](https://github.com/openid/accountchooser.com)
> \[OpenID\](https://openid.net/specs/openid-connect-core-1\_0.html)
> 
> Raised with @dmitrizagidulin

For implementing:

> **[Federated Credential Management API developer guide  |  Privacy...](https://developers.google.com/privacy-sandbox/3pcd/fedcm-developer-guide)**

In terms of my implementation, one caveat of FedCM is that it doesn’t currently specify a format for the returned token. There’s already an implementation for IndieAuth that integrates well with some of their semantics. I’m currently doing something slightly simpler for LastLogin. I’m just returning an OIDC ID token, which the client is expected to hand to the backend which will then verify it and create a session.

I’ve got a test instance running at lastlogin dot net (sorry can only post 2 links). Note this should currently be considered _insecure_, but should be fairly complete for testing FedCM.

Please let me know if you have any questions!

---

<div class="post-metadata">

**Author:** ![angus](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/angus/32/2295_2.png) [@angus](https://socialhub.activitypub.rocks/u/angus)\
**Post date:** [May 20, 2024, 7:28am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/6 "2024-05-20T07:28:34Z")

</div>

I’m happy to handle the Discourse end of things. If you could give me some kind of access to your test instance, that’ll help me implement this in Discourse faster (if relevant my email is angus at pavilion dot tech). As an aside, I note that @thisismissem has said there may be some more spec work to do here. Is this the right time to be implementing this?

> **[Emelia 👸🏻 (@thisismissem@hachyderm.io)](https://hachyderm.io/@thisismissem/112468498047038678)**
>
> @erlend@writing.exchange @Discourse@mastodon.social I'm working on some things with @aaronpk@aaronparecki.com which will make adding such a plugin much easier, please stay tuned!
> 
> (There's a bunch of specification work to do)

---

<div class="post-metadata">

**Author:** ![erlend\_sh](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/erlend_sh/32/1876_2.png) [@erlend\_sh](https://socialhub.activitypub.rocks/u/erlend_sh)\
**Post date:** [May 20, 2024, 9:34am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/7 "2024-05-20T09:34:08Z")

</div>

> bunch of specification work to do

That could probably take a while, so there’s a lot of value in having something sooner rather than later for the FedCM people to look at.

---

<div class="post-metadata">

**Author:** ![apitman](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/apitman/32/2518_2.png) [@apitman](https://socialhub.activitypub.rocks/u/apitman)\
**Post date:** [May 20, 2024, 2:21pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/8 "2024-05-20T14:21:26Z")

</div>

> Is this the right time to be implementing this?

Here’s basically my understanding and take on the situation. 3rd party cookies (among other things) are going away because big tech is being pressured by regulation to improve privacy. But that will break federated login, which currently mostly happens via OAuth2 and OIDC from large providers. Google’s answer is FedCM, which Mozilla and Apple both support. Google as an organization is not incentivized to make FedCM work for anyone other than big tech. However, the people inside google who are actually implementing it are sympathetic to the open web, and are willing to make changes to the spec to allow you to use any IdP you want. This isn’t going to happen unless people build prototypes and a) prove that it can work with good UX and b) show some demand for it. I’ve decided the upside is worth me investing in trying out a half baked spec and giving feedback to improve it.

So yes, the spec is not finished, but in this case that’s a good thing because we can help push things in a direction that is much better for decentralization.

In terms of this Discourse plugin specifically. Even if you only had time to make a working draft prototype, that would save me a lot of time because I would only need to learn how to modify it, rather than starting from scratch learning Ruby+Discourse. I’m willing to do that if I have to (I’ve always admired Ruby from a distance, just never had a strong reason to use it), but it would be much faster with some help.

> If you could give me some kind of access to your test instance

How much access would you like? It’s currently running publicly at [https://lastlogin.net](https://lastlogin.net) and you’re welcome to hit it with whatever tests you like. If you prefer something you can start/stop yourself that can be arranged.

---

<div class="post-metadata">

**Author:** ![thisismissem](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/thisismissem/32/1918_2.png) [@thisismissem](https://socialhub.activitypub.rocks/u/thisismissem)\
**Post date:** [May 20, 2024, 2:51pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/9 "2024-05-20T14:51:35Z")

</div>

Yeah, so there’s a bunch of open issues to resolve, see:

- [Allow IdP registration and RPs to match on a "type" · Issue #585 · fedidcg/FedCM · GitHub](https://github.com/fedidcg/FedCM/issues/585)
- [Add `interaction_required` error response · Issue #590 · fedidcg/FedCM · GitHub](https://github.com/fedidcg/FedCM/issues/590) (related: [Authorizing non-profile oauth scopes · Issue #477 · fedidcg/FedCM · GitHub](https://github.com/fedidcg/FedCM/issues/477) )
- [Allow RPs to provide their own terms of service and privacy policy URLs for "configURL: any" option · Issue #581 · fedidcg/FedCM · GitHub](https://github.com/fedidcg/FedCM/issues/581)
- [Allow IdPs to return JSON objects rather than Strings back to RPs · Issue #578 · fedidcg/FedCM · GitHub](https://github.com/fedidcg/FedCM/issues/578)

But the big issue is “how do you get a `client_id` before you know the IdP?”, that’s going to be the blocker for many. At the moment, IndieAuth “discovers” the client metadata via parsing microformats in the html at the `client_id` URL.

The IETF OAuth draft specification I’m currently working on is allowing `client_id` to be a JSON document, this is inspired by the [Solid-OIDC Client Identifier Documents](https://solidproject.org/TR/oidc#clientids-document) — essentially we’re lifting this up to be part of OAuth 2.

This means that you pass a `client_id` of your client identifier metadata document, and the IdP automatically registers a client for that `client_id` if necessary, using the data in that document.

This solves that question.

---

<div class="post-metadata">

**Author:** ![apitman](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/apitman/32/2518_2.png) [@apitman](https://socialhub.activitypub.rocks/u/apitman)\
**Post date:** [May 20, 2024, 3:24pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/10 "2024-05-20T15:24:36Z")

</div>

> [@thisismissem](#):
>
> But the big issue is “how do you get a `client_id` before you know the IdP?”

Can you explain in more detail the problem here, or maybe link me to a previous discussion that covers it by chance?

Currently the `client_id` is set by the RP in the call to `navigator.credentials.get()`, that’s been sufficient for my purposes so far. Are there use cases it doesn’t cover?

---

<div class="post-metadata">

**Author:** ![thisismissem](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/thisismissem/32/1918_2.png) [@thisismissem](https://socialhub.activitypub.rocks/u/thisismissem)\
**Post date:** [May 21, 2024, 1:48am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/11 "2024-05-21T01:48:02Z")

</div>

How do you know what `client_id` to use **before** you know the IdP at which the client is registered?

If you make it a URL, then the IdP must do _something_ to potentially create a client, if a client with that `client_id` doesn’t already exist: how does the IdP do that?

Like, somehow N different servers all need to somehow know about your client app (RP)

In IndieAuth, it’s expected to fetch a HTML page and extract out client information via microformats.

---

<div class="post-metadata">

**Author:** ![apitman](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/apitman/32/2518_2.png) [@apitman](https://socialhub.activitypub.rocks/u/apitman)\
**Post date:** [May 21, 2024, 4:27am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/12 "2024-05-21T04:27:15Z")

</div>

Ah ok I think I see where you’re coming from. For my usage, the only necessary function of a `client_id` is to provide an audience value for the IdP to create an OIDC ID token. No other data is needed.

Essentially the flow I’m aiming for in [LastLogin](https://lastlogin.io) is:

1. User navigates to RP
2. RP initiates FedCM flow with `client_id` = RP URI, and an indication that it needs an IdP that supports minting OIDC ID tokens (as mentioned in [Allow IdP registration and RPs to match on a "type" · Issue #585 · fedidcg/FedCM · GitHub](https://github.com/fedidcg/FedCM/issues/585))
3. IdP verifies the user is logged in and creates an OIDC ID token with `aud` set to `client_id` which is returned through FedCM
4. RP frontend passes the OIDC token to the backend where it’s validated and a login session is created

---

<div class="post-metadata">

**Author:** ![samuelgoto](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/samuelgoto/32/2519_2.png) [@samuelgoto](https://socialhub.activitypub.rocks/u/samuelgoto)\
**Post date:** [May 21, 2024, 4:40am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/13 "2024-05-21T04:40:22Z")

</div>

@thisismissem can you expand on what else, other than what @apitman described, you need the client\_id for?

---

<div class="post-metadata">

**Author:** ![julianfoad](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/julianfoad/32/2267_2.png) [@julianfoad](https://socialhub.activitypub.rocks/u/julianfoad)\
**Post date:** [May 21, 2024, 6:48am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/14 "2024-05-21T06:48:33Z")

</div>

Could a moderator (@angus ?) kindly promote the New joiners here (@apitman, @samuelgoto) to Basic level? (Asking because from reading about Trust Levels I understood manual promotion may be considered appropriate, and Sam said out-of-band that he wanted to post again but was limited.)

---

<div class="post-metadata">

**Author:** ![sebadob](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@sebadob](https://socialhub.activitypub.rocks/u/sebadob)\
**Post date:** [May 21, 2024, 6:51am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/15 "2024-05-21T06:51:23Z")

</div>

> But the big issue is “how do you get a `client_id` before you know the IdP?

@thisismissem the way I am solving things like these with [Rauthy](https://github.com/sebadob/rauthy) currently is by instead of accepting a json for the client id, which would end up in a possibly very huge URL and may leak client-internal information in logs and stuff, is by accepting a URL instead. But this URL does not point to an HTML you have to parse, but simply to a JSON on a remote host which can be deserialized into a valid client config.  
Basically like with OIDC dynamic client registration, but as ephemeral clients.

This keeps the URL short and you don’t need anything in advance, as well as you don’t need to parse HTML and its super easy to use. You are in charge of your own config then and can even easily modify it in the future without the need to care about remote-managed dynamically registered clients, which would not work with FedCM anyway, because the RP will not know the IdP beforehand.

Edit:

> If you make it a URL, then the IdP must do _something_ to potentially create a client, if a client with that `client_id` doesn’t already exist: how does the IdP do that?

That can’t exist, because the `client_id` will be the URL itself, not some self-chosen name, and you will not save any of this information. It is stateless.

---

<div class="post-metadata">

**Author:** ![angus](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/angus/32/2295_2.png) [@angus](https://socialhub.activitypub.rocks/u/angus)\
**Post date:** [May 21, 2024, 7:34am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/16 "2024-05-21T07:34:17Z")

</div>

> [@julianfoad](#):
>
> Could a moderator (@angus ?) kindly promote the New joiners here (@apitman, @samuelgoto) to Basic level?

Done!

> [@thisismissem](#):
>
> This means that you pass a `client_id` of your client identifier metadata document, and the IdP automatically registers a client for that `client_id` if necessary, using the data in that document.

This makes sense to me.

> [@apitman](#):
>
> Essentially the flow I’m aiming for in [LastLogin](https://lastlogin.io) is:

I can also see why you’ve landed on this flow. That said, there is a slight difference between this flow and the solution @thisismissem is proposing.

> [@sebadob](#):
>
> But this URL does not point to an HTML you have to parse, but simply to a JSON on a remote host which can be deserialized into a valid client config.

This seems to be similar to what @thisismissem is suggesting? Maybe I’m misunderstanding.

I think I’m going to let this settle a bit before implementing it in a Discourse plugin. I feel you guys are close, but I don’t want to jump the gun. I hope this doesn’t come across the wrong way, I’m keen to implement this, but I think the approach needs to be settled a bit more first for a RP implementation to make sense.

---

<div class="post-metadata">

**Author:** ![thisismissem](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/thisismissem/32/1918_2.png) [@thisismissem](https://socialhub.activitypub.rocks/u/thisismissem)\
**Post date:** [May 21, 2024, 10:54am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/17 "2024-05-21T10:54:11Z")

</div>

> [@angus](#):
>
> > [@sebadob](#):
> >
> > But this URL does not point to an HTML you have to parse, but simply to a JSON on a remote host which can be deserialized into a valid client config.
> 
> This seems to be similar to what @thisismissem is suggesting? Maybe I’m misunderstanding.

Yes, correct. You can basically already see this in solid-oidc, but I’m writing an official spec for it for OAuth, such that it can be referenced everywhere, rather than everyone implementing slightly different things

Also, fwiw, everything here was already discussed between myself and Aaron, I was hoping to get a draft up before announcing it, but as people were talking intent-to-implement, I wanted to warn that we’ll soon have a spec that solves a bunch of the problems

---

<div class="post-metadata">

**Author:** ![sebadob](https://socialhub.activitypub.rocks/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@sebadob](https://socialhub.activitypub.rocks/u/sebadob)\
**Post date:** [May 21, 2024, 10:58am UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/18 "2024-05-21T10:58:31Z")

</div>

Ahh okay, then I misunderstood, sorry.  
I would like an official spec a lot and would be happy if I can help.

---

<div class="post-metadata">

**Author:** ![apitman](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/apitman/32/2518_2.png) [@apitman](https://socialhub.activitypub.rocks/u/apitman)\
**Post date:** [May 21, 2024, 1:25pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/19 "2024-05-21T13:25:18Z")

</div>

So is the primary functionality we’re looking for with a client ID document the ability to present an RP name/logo/etc, or are there some additional capabilities that are unlocked by having one?

---

<div class="post-metadata">

**Author:** ![apitman](https://socialhub.activitypub.rocks/user_avatar/socialhub.activitypub.rocks/apitman/32/2518_2.png) [@apitman](https://socialhub.activitypub.rocks/u/apitman)\
**Post date:** [May 21, 2024, 1:32pm UTC](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961/20 "2024-05-21T13:32:10Z")

</div>

> [@angus](#):
>
> Done!

Thanks!

> [@angus](#):
>
> I can also see why you’ve landed on this flow. That said, there is a slight difference between this flow and the solution @thisismissem is proposing.

Agreed. My flow is working for my prototype, but I suspect I might be missing something important and want to understand better the tradeoffs.

> [@angus](#):
>
> I think I’m going to let this settle a bit before implementing it in a Discourse plugin. I feel you guys are close, but I don’t want to jump the gun. I hope this doesn’t come across the wrong way, I’m keen to implement this, but I think the approach needs to be settled a bit more first for a RP implementation to make sense.

Totally understandable! I might end up taking a crack at this myself so people can use FedCM to log in to [IndieBits](https://forum.indiebits.io/) using FedCM on LastLogin. This would also be a good way to test if my minimal flow has any holes in it.

Would you potentially be available on a chat platform to answer Discourse/Ruby questions occasionally?

[Next page](https://socialhub.activitypub.rocks/t/federated-credentials-api-developer-feedback-needed/3961.md?page=2)
