From 0ed01f430d0cd44f8041176c987508e76661a196 Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Thu, 16 May 2024 18:57:13 +0000 Subject: [PATCH] fix(bedrock_httpx.py): Fix OIDC support. --- litellm/llms/bedrock_httpx.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/litellm/llms/bedrock_httpx.py b/litellm/llms/bedrock_httpx.py index a51f57b3e01..de0a08426c4 100644 --- a/litellm/llms/bedrock_httpx.py +++ b/litellm/llms/bedrock_httpx.py @@ -275,7 +275,14 @@ class BedrockLLM(BaseLLM): DurationSeconds=3600, ) - return sts_response["Credentials"] + session = boto3.Session( + aws_access_key_id=sts_response["Credentials"]["AccessKeyId"], + aws_secret_access_key=sts_response["Credentials"]["SecretAccessKey"], + aws_session_token=sts_response["Credentials"]["SessionToken"], + region_name=aws_region_name, + ) + + return session.get_credentials() elif aws_role_name is not None and aws_session_name is not None: sts_client = boto3.client( "sts",