Add test for ProtectedResourceMetadataParsing (#1236)

Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
This commit is contained in:
Yann Jouanin 2025-09-23 13:48:21 +02:00 • committed by GitHub
commit 20596e5f41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -342,11 +342,8 @@ class TestAuthEndpoints:
@pytest.mark.anyio
async def test_metadata_endpoint(self, test_client: httpx.AsyncClient):
"""Test the OAuth 2.0 metadata endpoint."""
print("Sending request to metadata endpoint")
response = await test_client.get("/.well-known/oauth-authorization-server")
print(f"Got response: {response.status_code}")
if response.status_code != 200:
print(f"Response content: {response.content}")
assert response.status_code == 200
metadata = response.json()
@ -399,9 +396,7 @@ class TestAuthEndpoints:
"redirect_uri": "https://client.example.com/callback",
},
)
print(f"Status code: {response.status_code}")
print(f"Response body: {response.content}")
print(f"Response JSON: {response.json()}")
assert response.status_code == 400
error_response = response.json()
assert error_response["error"] == "invalid_grant"