Skip to content

Commit 7eeee6c

Browse files
committed
Address review: clarify iss migration note, make callback getters properties
- migration.md: spell out that omitting iss raises OAuthFlowError against servers advertising authorization_response_iss_parameter_supported, rather than merely disabling the check. - simple-auth-client example: convert get_state/get_iss to @Property.
1 parent 9373eab commit 7eeee6c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def callback_handler() -> AuthorizationCodeResult:
7878
)
7979
```
8080

81-
Forward the `iss` query parameter from the redirect so the validation can run; omitting it disables the issuer check for servers that send `iss`.
81+
Forward the `iss` query parameter from the redirect so the validation can run: omitting it makes the flow fail with `OAuthFlowError` against servers that advertise `authorization_response_iss_parameter_supported`, and silently skips the check for servers that send `iss` without advertising it.
8282

8383
### `get_session_id` callback removed from `streamable_http_client`
8484

examples/clients/simple-auth-client/mcp_simple_auth_client/main.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ def wait_for_callback(self, timeout: int = 300):
157157
time.sleep(0.1)
158158
raise Exception("Timeout waiting for OAuth callback")
159159

160-
def get_state(self):
161-
"""Get the received state parameter."""
160+
@property
161+
def state(self):
162+
"""The received state parameter."""
162163
return self.callback_data["state"]
163164

164-
def get_iss(self):
165-
"""Get the received iss parameter."""
165+
@property
166+
def iss(self):
167+
"""The received iss parameter."""
166168
return self.callback_data["iss"]
167169

168170

@@ -193,9 +195,7 @@ async def callback_handler() -> AuthorizationCodeResult:
193195
print("⏳ Waiting for authorization callback...")
194196
try:
195197
auth_code = callback_server.wait_for_callback(timeout=300)
196-
return AuthorizationCodeResult(
197-
code=auth_code, state=callback_server.get_state(), iss=callback_server.get_iss()
198-
)
198+
return AuthorizationCodeResult(code=auth_code, state=callback_server.state, iss=callback_server.iss)
199199
finally:
200200
callback_server.stop()
201201

0 commit comments

Comments
 (0)