variable format for filter in cognito

白昼怎懂夜的黑 提交于 2020-07-23 20:08:40

问题


i am trying to get user details from cognito based on sub id, below is code for the same(Filter="sub ="XXXXX-dCCa-4121-94c9-XXXXXX""), now i want to pass the variable in filter , tried with below format but its not working, what is the exact format to pass variable in filter,

code : import boto3

  client = boto3.client('cognito-idp',region_name='us-east-2',
                 aws_access_key_id='XXXXXX',
                 aws_secret_access_key='XXXXXXX',
                 )
   id='XXXXX-dCCa-4121-94c9-XXXXXX'
 response1 = client.list_users(UserPoolId='us-east-2_XXXXXX',AttributesToGet= 
 ['birthdate','name','sub'], Filter="sub = \"" + id + "\"")
 print(response1)

来源:https://stackoverflow.com/questions/62663272/variable-format-for-filter-in-cognito

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!