Files
Max Isbey 96c7a43187 fix: strip trailing slashes from OAuth metadata URL fields
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 that validate per
RFC 8414 §3.3 and RFC 9728 §3, which require the returned issuer/resource
URL to be identical to the URL used for discovery.

Add field_serializer to OAuthMetadata.issuer,
ProtectedResourceMetadata.resource, and
ProtectedResourceMetadata.authorization_servers to strip the trailing
slash during JSON serialization.

Fixes #1919
Fixes #1265

Reported-by: joar
Github-Issue: #1919
2026-01-22 19:24:13 +00:00
..
2026-01-22 14:50:39 +01:00
2026-01-22 14:50:39 +01:00
2024-09-24 22:04:19 +01:00
2025-02-05 11:02:51 +00:00