Add subject and claims to AccessToken (#2686)
This commit is contained in:
parent
e8e6484278
commit
3eb579948a
1 changed files with 27 additions and 2 deletions
|
|
@ -208,9 +208,14 @@ class Context(BaseModel, Generic[LifespanContextT, RequestT]):
|
|||
related_request_id=self.request_id,
|
||||
)
|
||||
|
||||
# TODO(maxisbey): see if this is needed otherwise remove
|
||||
@property
|
||||
def client_id(self) -> str | None:
|
||||
"""Get the client ID if available."""
|
||||
"""Get the client ID if available.
|
||||
|
||||
Note: this reads from the MCP request's `_meta` params, not the OAuth
|
||||
bearer token. For that, use `get_access_token().client_id`.
|
||||
"""
|
||||
return self.request_context.meta.get("client_id") if self.request_context.meta else None # pragma: no cover
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Reference in a new issue