Skip to content

Allow IDPs to delegate well-known file hosting via DNS TXT record#821

Open
will-bartlett wants to merge 7 commits intow3c-fedid:mainfrom
will-bartlett:dns-well-known-host
Open

Allow IDPs to delegate well-known file hosting via DNS TXT record#821
will-bartlett wants to merge 7 commits intow3c-fedid:mainfrom
will-bartlett:dns-well-known-host

Conversation

@will-bartlett
Copy link
Copy Markdown

@will-bartlett will-bartlett commented Mar 25, 2026

Adds a _fedcm DNS TXT record mechanism that allows IDPs to indicate which subdomain should host the well-known file, instead of requiring it at the registrable domain (apex). This addresses operational challenges for organizations where the apex domain is operated by a different service than the authentication service.

  • Add 'resolve the well-known host' algorithm that queries _fedcm.
  • Distinguish DNS 'no record' (fallback to apex) from DNS errors (hard fail)
  • Extract well-known fetch into reusable 'fetch a well-known resource' algorithm
  • Update well-known file documentation with DNS examples
  • Add Deployment Considerations section explaining motivation

Addresses: #809


Preview | Diff

Adds a _fedcm DNS TXT record mechanism that allows IDPs to indicate
which subdomain should host the well-known file, instead of requiring
it at the registrable domain (apex). This addresses operational
challenges for organizations where the apex domain is operated by a
different service than the authentication service.

- Add 'resolve the well-known host' algorithm that queries _fedcm.<domain>
- Distinguish DNS 'no record' (fallback to apex) from DNS errors (hard fail)
- Extract well-known fetch into reusable 'fetch a well-known resource' algorithm
- Update well-known file documentation with DNS examples
- Add Deployment Considerations section explaining motivation

Addresses: w3c-fedid#809
Copy link
Copy Markdown
Collaborator

@samuelgoto samuelgoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff @will-bartlett ! Clarification questions!!!

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
@samuelgoto
Copy link
Copy Markdown
Collaborator

I also wanted to say that I personally empathize so much with this proposal here because I cannot set a .well-known file in my personal website running in https://sgo.to, but WOULD be able to set a DNS record, so this PR would resolve a long standing issue that I have not being able to run my own FedCM IdP!!!

Comment thread spec/index.bs
Comment thread spec/index.bs Outdated
@samuelgoto samuelgoto added the agenda+ Regular CG meeting agenda items label Mar 30, 2026
@ThisIsMissEm
Copy link
Copy Markdown

@will-bartlett
Copy link
Copy Markdown
Author

Does this reference https://datatracker.ietf.org/doc/draft-ietf-dnsop-domain-verification-techniques/12/ by any chance?

I don't think so. There's no unique token for challenge and response, because it's all public metadata.

You did send me reading a bit though. I wonder if I should be aligning with RFC 9460 Service Binding. A _web-identity SVCB record instead of TXT. Such a record could either point to the well known file or replace the well known file. I guess it depends on whether we expect the well known file to grow. With one or two parameters (config or accounts+login), it fits in DNS, but if it were to grow to many parameters, it might not fit.

@samuelgoto
Copy link
Copy Markdown
Collaborator

A _web-identity SVCB record instead of TXT

Something that I'd be concerned about, specially in the context of decentralizing FedCM, is that if I had to guess, most DNS registrars allow their users to set TXT records but disallow setting SVCB records?

@ThisIsMissEm
Copy link
Copy Markdown

@will-bartlett I can't really provide any guidance here, since I'm absolutely not an expert when it comes to DNS. I would strongly recommend reaching out to the DNSOP WG mailing list: https://mailman3.ietf.org/mailman3/lists/dnsop@ietf.org/ or contact them via socials: https://datatracker.ietf.org/wg/dnsop/about/

@will-bartlett
Copy link
Copy Markdown
Author

I think there's maybe three key decision points:

  1. Do we want to do this at all, do we agree this is a problem worth solving?
  2. Existing first, new first, or both in parallel? If both in parallel, does first response win (which permits intermittent but decreases latency), or must both either be matching or one errored?
  3. DNS replacing well known (SVCB or TXT record contains values from well known file), DNS to find well known (SVCB or TXT record contains domain of well known file), or HTTPS to well known in fixed subdomain (i.e. web-identity.)?

I think my answers and rationale would be:

  • Yes, this is a problem worth solving, see prior discussion.
  • DNS replacing well known, for optimal performance
  • New first, because DNS is most lightweight and the majority of FedCM deployments don't exist yet, and existing deployments can always update to be optimal (and browser makers can always actually do them in parallel to avoid losing perf in transition). And because we don't expect more globally unique paths other than accounts and login url.

most DNS registrars allow their users to set TXT records but disallow setting SVCB records?

Hm, I'm no expert, but Copilot seems to say this is true. I don't really have a strong opinion, other than to remark that such things are self-perpetuating. Specs support TXT because registrars don't support new records and registrars don't support new records because specs support TXT.

@samuelgoto
Copy link
Copy Markdown
Collaborator

samuelgoto commented Mar 30, 2026

Edit: I changed some of my answers based on re-reading your comments and digesting them further.

I think my answers and rationale would be:

I think mine would be:

  • Yes, this is a problem worth solving, see prior discussion.
  • You are raising a good point on "And because we don't expect more globally unique paths other than accounts and login url." .... I can't think of anything that we would expect to be globally unique .... I think that if that was right, I'd agree with you that "DNS replacing well known, for optimal performance". But I'm thinking that the option "HTTPS to well known in fixed subdomain (i.e. web-identity.)" also gives you TLS encryption of the values (and also makes its size unbounded for free?)?
  • Good question on "existing first, new first or both in parallel". I think I could live with "New first" too, but that's a tough call, see notes below, to see if existing IdPs are going to be OK with that.

So yeah, I think, having thought about this for a second time, that your original answers seem like the right ones to me too.

Just a few notes:

  • On question number 2: I'm a bit surprised by "the majority of FedCM deployments don't exist yet" because we currently make FedCM requests for 3% of chrome page loads, which is quite a lot, but maybe you are envisioning something that will 10x that? One way to think about this too is to ask ourselves "what's the best that we can do?" and then "default to that" and work with existing IdPs to say "we'll make a performance/latency regression on your deployment at the moment, but here is how you can go and fix it". So, on question number 2, I think my head is at "what's the right thing to do?" now, and walk backwards from it.
  • On question number 3: I think your observation of "how many more things need to be globally unique" is a really good one. Just thinking out loud, I was actually hoping that we'd get rid of the configURL at some point and only use the .well-known files, because that makes them easier to be discovered (e.g. given a domain, you can figure out how to use it as an IdP).

@will-bartlett
Copy link
Copy Markdown
Author

Ok. I've updated the PR now to have all the options and marked my preferences. All my preferences are fairly weak however, so I'm happy to align with whatever we conclude when we meet.

also gives you TLS encryption of the values

I wasn't sure how important this was, given that the values must match the values from the config file, which is received over TLS.

we currently make FedCM requests for 3% of chrome page loads, which is quite a lot

Wow! That is quite a lot! 1) Maybe I don't have my facts right. 2) I was thinking about IDPs more than RPs - I expect that huge/complex IDPs adopt FedCM sooner than small ones, but also have a greater capacity to deal with revisions.

I was actually hoping that we'd get rid of the configURL at some point and only use the .well-known files, because that makes them easier to be discovered (e.g. given a domain, you can figure out how to use it as an IdP).

I don't know how to do N=1 for Microsoft Entra. Microsoft lets tenants brand the login screen, all within the single Entra domain (login.microsoftonline.com). What the spec says right now works for us, because we can have per-customer branding in config files (/customerid/fedcm/config.json) and common endpoints in well-known files.

RFC8414 does an interesting thing with well-known, where it puts subpaths in the well known. It says that configuration files should be located at idp.example/.well-known/oauth-authorization-server/customerid/v2.0 in Microsoft's setup. FedCM could do something like this for config files - idp.example/.well-known/web-identity/customerid, i.e. switch from configUrl to configDomain + configPath, or require that configUrl's path start with .well-known/web-identity - but that doesn't really seem to solve your discovery goals, if configPath is not auto-discoverable.

@hlflanagan
Copy link
Copy Markdown
Contributor

Discussed on the 7 April 2026 call. @hlflanagan will take the architectural question to the TAG. The WG/CG are strongly advised to review this PR and indicate their preferred option so we can resolve the .well-known question.

@hlflanagan hlflanagan removed the agenda+ Regular CG meeting agenda items label Apr 7, 2026
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated

##### Option 1A: SVCB record with embedded data (Preferred) ##### {#option-1a}

In this option, the user agent queries a DNS [[RFC9460]] SVCB record at
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing DNS record resolution (SVCB or TXT) directly in a web specification is a layering violation. There is no standard primitive in the WHATWG/W3C ecosystem for "resolve a DNS record." By specifying this, you are forcing the user agent to integrate a custom network-layer API into the web platform's processing model.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In practice, the user agent has already done this integration to support RFC 9460 (SVCB / HTTPS RRs). It's a layering violation only on paper, not in practice. Still, I've included option 1C in case folks think this conceptual layering violation is unsuitable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, this is very much an in practice layering violation too, as @cbiesinger found out when implementing a similar DNS query for EVP.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please share details? These sort of allusions to unspecified problems are not as helpful as details

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's why I tagged Christian, I don't know the details

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated

<!-- BEGIN OPTION 2A -->

##### Option 2A: Existing fetch first, new as fallback ##### {#option-2a}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear if this would actually work reasonably well for IDPs that cannot modify the existing location of well-known. Eg if the current fetch would timeout for them, this would not work. It would only work if the current fetch would always quickly fail.

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
@will-bartlett
Copy link
Copy Markdown
Author

@npm1 - the ask from the most recent notes (4/7) is for participants to express their preferences for how to solve this problem. I understand from your comments that for the first decision point, you prefer option C, as it avoids a conceptual layering violation. However, you left negative feedback about all options for the second decision point. Can you clarify your preference of the available options, or suggest a new option? Alternatively, if you'd prefer no option, i.e. if you think this problem is not worth solving, you can share that as well.

@npm1
Copy link
Copy Markdown
Collaborator

npm1 commented Apr 9, 2026

@npm1 - the ask from the most recent notes (4/7) is for participants to express their preferences for how to solve this problem. I understand from your comments that for the first decision point, you prefer option C, as it avoids a conceptual layering violation. However, you left negative feedback about all options for the second decision point. Can you clarify your preference of the available options, or suggest a new option? Alternatively, if you'd prefer no option, i.e. if you think this problem is not worth solving, you can share that as well.

The ask, both in the call and in the comment which I'm quoting below, is to read and review the PR and express preferences. My preference would be 1C and 2A (or fetching both new and existing at the same time but giving priority to the existing, which I think is not any of the options: 2E?), but subject to this actually resolving the use cases, which is why I left a comment there on why it might not. Also, you called me out as being an editor and not reviewing in a timeline fashion, so not sure why you are not happy about my review?

Discussed on the 7 April 2026 call. @hlflanagan will take the architectural question to the TAG. The WG/CG are strongly advised to review this PR and indicate their preferred option so we can resolve the .well-known question.

@will-bartlett
Copy link
Copy Markdown
Author

The ask, both in the call and in the comment which I'm quoting below, is to read and review the PR and express preferences. My preference would be 1C and 2A

Thanks for clarifying. It wasn't clear from your other comments that you preferred 2A.

Also, you called me out as being an editor and not reviewing in a timeline fashion, so not sure why you are not happy about my review?

I don't believe I called you out specifically in the WG call - that was certainly not my intention. I merely asked all participants to take a look.

I also don't think I expressed any unhappiness with your review - not sure what that it in reference to. To be clear, I appreciate you reviewing the PR. I only asked you to clarify which option you preferred for decision point 2.

@will-bartlett
Copy link
Copy Markdown
Author

It occurs to me that there's perhaps another option for compatibility, 2E, which is just to have the relying party specify.

      let token = await navigator.credentials.get({
        identity: {
          providers: [{
            configURL: "https://idp.example/manifest.json",
            clientId: "123",
            privacyMode: "apex-http"
          }]
        }
      });
      let token = await navigator.credentials.get({
        identity: {
          providers: [{
            configURL: "https://idp.example/manifest.json",
            clientId: "123",
            privacyMode: "apex-dns"
          }]
        }
      });

That avoids the timeout or race condition choice, but muddles the API with an additional parameter.

Maybe 2F is to put privacyMode in manifest.json.

It adds a bit of data - the IdP can categorize RPs into one of two buckets based on which mode they use. But I'm not sure how much of a problem that really is - two buckets doesn't seem to be a big deal.

@will-bartlett
Copy link
Copy Markdown
Author

A DNSOP participant (Ben Schwartz) has another suggestion (let's call it 2G) which is to specify FedCM to only send origin-scoped cookies (i.e. those with _Host) prefix. This could be on the manifest as a "privacyMode":"originScopedCookies". This would allow hosting the well-known file on the same origin rather than on the registrable domain. However, it is a whole new mode for sending cookies, which brings its own complexities.

@npm1
Copy link
Copy Markdown
Collaborator

npm1 commented Apr 10, 2026

A DNSOP participant (Ben Schwartz) has another suggestion (let's call it 2G) which is to specify FedCM to only send origin-scoped cookies (i.e. those with _Host) prefix. This could be on the manifest as a "privacyMode":"originScopedCookies". This would allow hosting the well-known file on the same origin rather than on the registrable domain. However, it is a whole new mode for sending cookies, which brings its own complexities.

The manifest and well-known fetches are uncredentialed.

@will-bartlett
Copy link
Copy Markdown
Author

A DNSOP participant (Ben Schwartz) has another suggestion (let's call it 2G) which is to specify FedCM to only send origin-scoped cookies (i.e. those with _Host) prefix. This could be on the manifest as a "privacyMode":"originScopedCookies". This would allow hosting the well-known file on the same origin rather than on the registrable domain. However, it is a whole new mode for sending cookies, which brings its own complexities.

The manifest and well-known fetches are uncredentialed.

I know. I mean that the manifest could indicate that the accountUrl and loginUrl fetches only send origin scoped cookies (cookies whose 'host-only' flag is true, in the language of 6252bis). But I'm thinking this is probably too complex. We'd have to update 6252bis to have multiple retrieval modes and then update fetch to have a new credential modes which correspond to the new retrieval modes. And I don't think we'll convince the 6525bis folks - cookies are hard enough without modes.

@bemasc
Copy link
Copy Markdown

bemasc commented Apr 13, 2026

Here's that message.

I don't claim to understand the whole flow here, but I doubt that new DNS records are the right answer.

Regarding origin-scoped cookies, another option would be to disable cookies entirely and keep the login state in LocalStorage (etc.), which already has the desired origin-scoping behavior.

@will-bartlett
Copy link
Copy Markdown
Author

will-bartlett commented Apr 13, 2026

Ok. I've updated this PR substantially. It now no longer display options, but focuses exclusively on the DNS option. It also includes that the new result is preferred over the old (matching @samuelgoto 's preference) and a note that browsers can make them in parallel to preserve performance in the short term.

I will send out a second PR with the other option (HTTP to fixed subdomain). This is my preferred option at this point. The only substantial con is the layering issues with web specs depending on DNS, which seems to be mostly a theory issue rather than a practical one.

Regarding origin-scoped cookies, another option would be to disable cookies entirely and keep the login state in LocalStorage (etc.), which already has the desired origin-scoping behavior.

Needs to be credentials under fetch's definition, which basically means cookies, mtls, or basic/digest auth.

@samuelgoto
Copy link
Copy Markdown
Collaborator

I will send out a second PR with the other option (HTTP to fixed subdomain). This is my preferred option at this point.

Would that be Option (C) described here? If so, yeah, that's my preferred option too.

Option C: Fixed subdomain — No DNS lookup; always fetch from web-identity.<registrable-domain>, which the IDP points (e.g., via CNAME) to their infrastructure.

If so, should we include that in this PR rather than a second one?

Comment thread spec/index.bs
@will-bartlett
Copy link
Copy Markdown
Author

Here's that other PR: #823

@will-bartlett
Copy link
Copy Markdown
Author

This is my preferred option at this point.

I meant "This [PR (that uses DNS)] is my preferred option" - but I'm ok with either.

@samuelgoto samuelgoto added the agenda+ Regular CG meeting agenda items label Apr 17, 2026
@hlflanagan
Copy link
Copy Markdown
Contributor

Discussed during 21 April 2026 meeting. WG/CG encouraged to review how WebAuthn handles this. Will continue discussion at the next call (5 May 2026).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agenda+ Regular CG meeting agenda items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants