Skip to content

Add {path}/.well-known/oauth-authorization-server as a discovery URL fallback #1944

@jerome3o-anthropic

Description

@jerome3o-anthropic

Problem

When discovering OAuth Authorization Server Metadata, the SDK currently tries the following URL patterns (via build_oauth_authorization_server_metadata_discovery_urls):

  1. /.well-known/oauth-authorization-server{path} — RFC 8414 path-aware
  2. /.well-known/openid-configuration{path} — RFC 8414 Section 5 OIDC path-aware
  3. {path}/.well-known/openid-configuration — OIDC 1.0 discovery

However, it does not try {path}/.well-known/oauth-authorization-server.

Some OAuth providers (notably Azure Databricks) serve their OAuth Authorization Server Metadata at this path. For example:

https://<workspace>.azuredatabricks.net/oidc/.well-known/oauth-authorization-server

This returns a fully compliant metadata document with authorization_endpoint, token_endpoint, scopes_supported, code_challenge_methods_supported (PKCE), etc. — everything needed for a successful OAuth flow. Without discovering this metadata, clients fall back to incorrect default endpoints (e.g. /authorize instead of /oidc/v1/authorize) and wrong scopes.

Spec context

To be clear: {path}/.well-known/oauth-authorization-server is not the RFC 8414 URL construction. RFC 8414 Section 3 specifies that the well-known URI is inserted between the host and path components, producing /.well-known/oauth-authorization-server{path} — which the SDK already supports.

However, the SDK already supports the analogous non-RFC-8414 pattern for OIDC: {path}/.well-known/openid-configuration (pattern #3 above), which follows the OIDC 1.0 Discovery convention of appending the well-known suffix to the issuer URL. The missing pattern is simply the OAuth equivalent of this — same URL construction approach, different well-known suffix.

Proposal

Add {path}/.well-known/oauth-authorization-server as a fallback URL in the discovery logic, for consistency with the existing OIDC 1.0 support. The discovery order would become:

  1. /.well-known/oauth-authorization-server{path} — RFC 8414
  2. {path}/.well-known/oauth-authorization-server — OAuth equivalent of OIDC 1.0 pattern ← new
  3. /.well-known/openid-configuration{path} — RFC 8414 Section 5
  4. {path}/.well-known/openid-configuration — OIDC 1.0

This is a low-risk, one-line addition as a fallback URL that maintains consistency with the existing OIDC 1.0 support and unblocks real-world providers that use this convention.

Metadata

Metadata

Assignees

Labels

P2Moderate issues affecting some users, edge cases, potentially valuable featureauthIssues and PRs related to Authentication / OAuth

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions