File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ def __init__(
151151 client_secret = None ,
152152 access_key = None ,
153153 secret_key = None ,
154+ session = None ,
155+ botocore_config = None ,
154156 ):
155157 """
156158 :param user_pool_id: Cognito User Pool ID
@@ -161,6 +163,8 @@ def __init__(
161163 :param access_token: Access Token returned by authentication
162164 :param access_key: AWS IAM access key
163165 :param secret_key: AWS IAM secret key
166+ :param session: Boto3 client session
167+ :param botocore_config: Botocore Config object for the client
164168 """
165169
166170 self .user_pool_id = user_pool_id
@@ -184,8 +188,13 @@ def __init__(
184188 boto3_client_kwargs ["aws_secret_access_key" ] = secret_key
185189 if self .user_pool_region :
186190 boto3_client_kwargs ["region_name" ] = self .user_pool_region
191+ if botocore_config :
192+ boto3_client_kwargs ["config" ] = botocore_config
187193
188- self .client = boto3 .client ("cognito-idp" , ** boto3_client_kwargs )
194+ if session :
195+ self .client = session .client ("cognito-idp" , ** boto3_client_kwargs )
196+ else :
197+ self .client = boto3 .client ("cognito-idp" , ** boto3_client_kwargs )
189198
190199 def get_keys (self ):
191200
You can’t perform that action at this time.
0 commit comments