Add support for the OAuth 2.0 Authorization Server Metadata Endpoint (RFC 8414)
Overview
This PR adds support for the OAuth 2.0 Authorization Server Metadata endpoint defined in RFC 8414. Alongside the existing OIDC discovery document, this PR exposes a dedicated well‑known endpoint for OAuth 2.0 metadata.
What this PR does / why we need it
- Implements the endpoint /.well-known/oauth-authorization-server as specified in RFC 8414.
- Introduces separate discovery structures for OIDC and OAuth2 to ensure correct metadata for each protocol.
- Adds full test coverage for both discovery endpoints.
This feature enables better interoperability with systems and MCPs that rely on OAuth 2.0 Authorization Server Metadata, making Dex more compliant with modern standards and forward‑looking integrations.
Related issue:
- #4444
@johnvan7 looks reasonable. Can you squash the commits into 1? At a minimum things won't compile until all the commits are together. The last one could be split off if we really wanted but practically I don't think it makes sense.
@cardoe Thanks for your advice, I did the squash in one commit.