Commit 2c0f2c3
authored
fix: strip trailing slashes from OAuth metadata URLs
Pydantic's AnyHttpUrl automatically appends a trailing slash to bare
hostnames (e.g., http://localhost:8000 becomes http://localhost:8000/).
This causes OAuth discovery to fail in clients like Google's ADK and
IBM's MCP Context Forge because RFC 8414 §3.3 and RFC 9728 §3 require
that the issuer/resource URL in the metadata response must be identical
to the URL used for discovery.
This fix ensures all URLs in OAuth metadata (issuer, resource,
authorization_servers) have trailing slashes stripped, following the
same pattern already used for authorization_endpoint and token_endpoint.
Github-Issue: #1919
Reported-by: joar1 parent 5301298 commit 2c0f2c3
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
0 commit comments