Skip to content

Commit 122bce8

Browse files
committed
feat(keycardai-oauth): remove the impersonation logic
1 parent f9d1ec9 commit 122bce8

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

packages/oauth/src/keycardai/oauth/operations/_token_exchange.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
from ..exceptions import OAuthHttpError, OAuthProtocolError
1111
from ..http._context import HTTPContext
1212
from ..http._wire import HttpRequest, HttpResponse
13-
from ..http.auth import NoneAuth
1413
from ..types.models import TokenExchangeRequest, TokenResponse
15-
from ..utils.jwt import get_claims
1614

1715

1816
def build_token_exchange_http_request(
@@ -28,12 +26,6 @@ def build_token_exchange_http_request(
2826
Returns:
2927
HttpRequest for the token exchange endpoint
3028
"""
31-
# Impersonate the client if not explicitly set to delegations
32-
if request.actor_token is None and request.client_id is None and isinstance(context.auth, NoneAuth):
33-
claims = get_claims(request.subject_token)
34-
request.client_id = claims.get("client_id")
35-
36-
3729
payload = request.model_dump(
3830
mode="json",
3931
exclude_none=True,

0 commit comments

Comments
 (0)