The example client_ID in Relay API reference may be incorrect

When I test relay API,using example figured in reference:
"import boto3
from warrant.aws_srp import AWSSRP

client = boto3.client(‘cognito-idp’)
aws = AWSSRP(username=‘API_KEY’, password=‘API_SECRET’, pool_id=‘us-west-2_iLmIggsiy’, client_id=‘1bpd19lcr33qvg5cr3oi79rdap’, client=client)
tokens = aws.authenticate_user()
print(‘Access Token’, tokens[‘AuthenticationResult’][‘AccessToken’])"

:computer: Environment

I got this error:
“botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the InitiateAuth operation: User pool client 1bpd19lcr33qvg5cr3oi79rdap does not exist.”


I check same guide on aws,that said:
“This error should only be thrown if the client id you are passing actually does not exist.”

What I actually want ask is have the client_id of user_pool been changed?
:1234: Code to reproduce

1 Like

Hey @loophe! I’ve just managed to reproduce the issue. Apparently boto fails to locate the user pool if it’s not in the default us-east-1 region, and ours is in us-west-2. Adding the region to the client initialization does the trick:

client = boto3.client('cognito-idp', region_name='us-west-2')

I’ll update the docs now. Thanks for reporting this!


yeah~I have got the access token!
It does work!

1 Like