Skip to content

Commit f983a04

Browse files
committed
Add test for client registration with additional grant type
1 parent 0c46320 commit f983a04

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/server/fastmcp/auth/test_auth_integration.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,23 @@ async def test_client_registration_invalid_grant_type(self, test_client: httpx.A
937937
assert error_data["error"] == "invalid_client_metadata"
938938
assert error_data["error_description"] == "grant_types must be authorization_code and refresh_token"
939939

940+
@pytest.mark.anyio
941+
async def test_client_registration_with_additional_grant_type(self, test_client: httpx.AsyncClient):
942+
client_metadata = {
943+
"redirect_uris": ["https://client.example.com/callback"],
944+
"client_name": "Test Client",
945+
"grant_types": ["authorization_code", "refresh_token", "urn:ietf:params:oauth:grant-type:device_code"],
946+
}
947+
948+
response = await test_client.post("/register", json=client_metadata)
949+
assert response.status_code == 201
950+
client_info = response.json()
951+
952+
# Verify client was registered successfully
953+
assert "client_id" in client_info
954+
assert "client_secret" in client_info
955+
assert client_info["client_name"] == "Test Client"
956+
940957
@pytest.mark.anyio
941958
async def test_client_registration_with_additional_response_types(
942959
self, test_client: httpx.AsyncClient, mock_oauth_provider: MockOAuthProvider

0 commit comments

Comments
 (0)