Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected params.AuthParameters['USERNAME'] to be a string #9

Open
jeremyhodges opened this issue Apr 27, 2018 · 5 comments
Open

Expected params.AuthParameters['USERNAME'] to be a string #9

jeremyhodges opened this issue Apr 27, 2018 · 5 comments

Comments

@jeremyhodges
Copy link

My AWS user pool is setup to use only phone numbers as the username. When I try to make an API call with this test cli I get the following message:

Authenticating with User Pool
Expected params.AuthParameters['USERNAME'] to be a string

I tried wrapping the username parameter in both single and double quotes. Same result.

npx aws-api-gateway-cli-test \
--username='15555555555' \
--password='Passw0rd!' \
...
@jayair
Copy link
Member

jayair commented Apr 30, 2018

@jeremyhodges I haven't tested it with phone numbers but we aren't doing anything specific for string based user names. We simply pass it to the Cognito JS SDK. Can you confirm that you are able to use the Cognito SDK to authenticate in your app?

@sjl2
Copy link

sjl2 commented Feb 12, 2019

Looks like yargs will take the input here for username, but the problem for phone numbers is that they're probably getting converted to numbers.

Every argument that looks like a number (!isNaN(Number(arg))) is converted to one. This way you can just net.createConnection(argv.port) and you can add numbers out of argv with + without having that mean concatenation, which is super frustrating.
Reference

PoC

node
> !isNaN(Number('+013333333333'))
true

Looks like the username argument will need to be coerced to a string.

@jayair
Copy link
Member

jayair commented Feb 18, 2019

@sjl2 Good catch! Thanks for looking into it. I'll test it out and update it.

@jmazala
Copy link

jmazala commented Jul 27, 2019

man this is irritating indeed lol

@jayair
Copy link
Member

jayair commented Aug 4, 2019

Fixed this in 1.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants