@@ -279,22 +279,17 @@ async def test_authorize_with_an_unregistered_redirect_uri_is_rejected_directly(
279279
280280
281281@requirement ("hosting:auth:as:redirect-uri-scheme" )
282- async def test_a_non_loopback_http_redirect_uri_is_accepted_at_registration (
282+ async def test_a_non_loopback_http_redirect_uri_is_rejected_at_registration (
283283 as_app : tuple [httpx .AsyncClient , InMemoryAuthorizationServerProvider ],
284284) -> None :
285- """A registration carrying a non-HTTPS, non-loopback redirect URI is accepted.
286-
287- The spec requires every redirect URI to be either HTTPS or a loopback host; the bundled
288- registration handler does not enforce this and registers `http://evil.example/callback`
289- successfully. See the divergence on the requirement.
290- """
291- http , provider = as_app
285+ """Non-loopback HTTP redirect URIs must be rejected during DCR."""
286+ http , _provider = as_app
292287 body = oauth_client_metadata ().model_dump (mode = "json" , exclude_none = True )
293288 body ["redirect_uris" ] = ["http://evil.example/callback" ]
294289
295290 response = await http .post ("/register" , json = body )
296291
297- assert response .status_code == 201
298- info = OAuthClientInformationFull . model_validate_json ( response .content )
299- assert [ str ( u ) for u in ( info . redirect_uris or [])] == [ "http://evil.example/callback" ]
300- assert info . client_id in provider . clients
292+ assert response .status_code == 400
293+ error = response .json ( )
294+ assert error [ "error" ] == "invalid_client_metadata"
295+ assert "unless loopback" in error [ "error_description" ]
0 commit comments