Comments: Create a Cognito Test User
Link to chapter - http://serverless-stack.com/chapters/create-a-cognito-test-user.html
to create the user and confirm I had to add an extra parameter to both calls (--region us-east-1)
$ aws cognito-idp sign-up \
--client-id YOUR_COGNITO_APP_CLIENT_ID \
--username [email protected] \
--password Passw0rd! \
--user-attributes Name=email,[email protected] \
_**--region us-east-1**_
@Pancakerobot good tip, we've gotten some feedback from some people that have run into region related issues.
I had the same problem. You get the region from your Pool Id. Mine was us-east-2_dUMVe5SZr but it doesn't look like you need anything after the underscore. so tacking on --region us-east-2 worked for me
Added it to the chapter - 562b54b252423011d418e16aed20083d403c4b18
I'm having trouble running
$ aws cognito-idp sign-up
--region us-east-1
--client-id YOUR_COGNITO_APP_CLIENT_ID
--username [email protected]
--password Passw0rd!
--user-attributes Name=email,[email protected]
Actually when I even try running the first line "aws cognito-idp sign-up" into the command prompt (im using windows), it just gives me this error.
I'm pretty sure I configured it in the beginning. Any help would be greatly appreciated.
`
@Hollow27 When you try the full command (with the client-id passed in), what is the error you are seeing?
This is what I'm getting (kind of a noob using the terminal):
Unknown output type: [None]
^thats what im getting when I try the full command with client-id passed in.
@Hollow27 Yeah I'm not too familiar with Windows. But @ryanjcruz is a Windows user. Maybe he can help you?
@jayair @Hollow27 you'd need to add \ at the end of the command per line i.e $ aws cognito-idp sign-up \ --region us-east-1 \ --client-id YOUR_COGNITO_APP_CLIENT_ID \ --username [email protected] \ --password Passw0rd! \ --user-attributes Name=email,[email protected]
then the last line shouldn't have any as that should be the enter key needed to execute the command.
@ryanjcruz I'm thinking of adding instructions for Windows users soon. I can use your help with that. Do you mind if I ping you once I figure out the format for it?
@jayair no probs, happy to help out.
@ryanjcruz It would help if the instructions show output from commands. Is "UserConfirmed": false, from the response I got expected?
{
"UserConfirmed": false,
"CodeDeliveryDetails": {
"AttributeName": "email",
"Destination": "a***@j***.com",
"DeliveryMedium": "EMAIL"
}
}
Also, having common error responses would be helpful as well. I'm writing because I got this doing verification:
An error occurred (UnrecognizedClientException) when calling the AdminConfirmSignUp operation: The security token included in the request is invalid.
The response is from this command:
aws cognito-idp admin-confirm-sign-up \
--region us-west-2 \
--user-pool-id us-west-2_bAEhmtfs7 \
--username [email protected]
The user-pool-id value I got from Pool details: Pool Id, above the Pool ARN.
@wilsonmar That's a good idea. I'll be adding sections to chapters with common errors people are getting.
Can you help me get un-stuck? If not, who can? I'll add to your tutorial is you help me.
On Mon, May 29, 2017 at 7:42 AM, Jay V [email protected] wrote:
@wilsonmar https://github.com/wilsonmar That's a good idea. I'll be adding sections to chapters with common errors people are getting.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AnomalyInnovations/serverless-stack-com/issues/18#issuecomment-304641293, or mute the thread https://github.com/notifications/unsubscribe-auth/AASUDo0eKEjL1QEHzr9m9Plf-YRKHxdIks5r-q8egaJpZM4M4OAz .
@wilsonmar The response you received for the sign-up step looks good. User will only be confirmed after the admin-confirm-sign-up step, which will succeed silently.
Your error An error occurred (UnrecognizedClientException) when calling the AdminConfirmSignUp operation: The security token included in the request is invalid. sounds very much like AWS CLI credentials not specified correctly. Could do refer to these two chapters and double check the CLI configuration.
http://serverless-stack.com/chapters/create-an-iam-user.html
http://serverless-stack.com/chapters/configure-the-aws-cli.html
At the end of the day, you should have a file at ~/.aws/credentials look similar to
[default]
aws_access_key_id = AKXXXXXXXXXXXXXXXXMQ
aws_secret_access_key = JOsGrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc132
OK, I Googled around and found this explanation on May 25, 2016 by EdL@AWS: "Cognito User Pools are currently only available in US East (Virginia)." at https://forums.aws.amazon.com/thread.jspa?messageID=722312
Since the first mention of region is at http://serverless-stack.com/chapters/create-an-s3-bucket-for-file-uploads.html I've forked, created branch 'Cognito-User-Pools-only-avail-US-East-1, and updated file as https://github.com/AnomalyInnovations/serverless-stack-com/pull/93
Cognito User Pools were made available in us-west-2, US West (Oregon) later in 2016. https://aws.amazon.com/blogs/aws/amazon-cognito-your-user-pools-now-generally-available/
You shouldn't be able to create the pool in the first place if it were not available.
I'll post the link where that AWS guy posted his fake news. Do you have a link I can go to for properly setting up the creditions file on my machine?
On Tue, May 30, 2017 at 8:06 PM, Frank [email protected] wrote:
Cognito User Pools were made available in us-west-2, US West (Oregon) later in 2016. https://aws.amazon.com/blogs/aws/amazon-cognito-your-user- pools-now-generally-available/
You shouldn't be able to create the pool in the first place if it were not available.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AnomalyInnovations/serverless-stack-com/issues/18#issuecomment-305043666, or mute the thread https://github.com/notifications/unsubscribe-auth/AASUDr2pQlurB5T7Wn1GGU6pgkzKI5ETks5r_K8QgaJpZM4M4OAz .
This should help - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
I have multiple AWS profiles for different accounts. Since the one I'm using for this tutorial isn't my default, I needed to add the --profile [profile name from my ~/.aws/credentials file] flag to both CLI commands. Hope this helps!