Create a Cognito Test User


#1

From @jayair on Mon Apr 10 2017 00:58:19 GMT+0000 (UTC)

Link to chapter - http://serverless-stack.com/chapters/create-a-cognito-test-user.html

Copied from original issue: https://github.com/AnomalyInnovations/serverless-stack-com/issues/18


#2

From @Pancakerobot on Mon Apr 10 2017 04:50:18 GMT+0000 (UTC)

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 admin@example.com \
  --password Passw0rd! \
  --user-attributes Name=email,Value=admin@example.com \
  _**--region us-east-1**_

#3

From @jayair on Mon Apr 10 2017 17:20:31 GMT+0000 (UTC)

@Pancakerobot good tip, we’ve gotten some feedback from some people that have run into region related issues.


#4

From @geirman on Fri Apr 14 2017 22:05:54 GMT+0000 (UTC)

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


#5

From @jayair on Fri Apr 14 2017 22:52:28 GMT+0000 (UTC)

Added it to the chapter - 562b54b252423011d418e16aed20083d403c4b18


#6

From @zohaibshahzadTO on Mon May 15 2017 02:05:18 GMT+0000 (UTC)

I’m having trouble running

$ aws cognito-idp sign-up
–region us-east-1
–client-id YOUR_COGNITO_APP_CLIENT_ID
–username admin@example.com
–password Passw0rd!
–user-attributes Name=email,Value=admin@example.com

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.

cmd trouble

I’m pretty sure I configured it in the beginning. Any help would be greatly appreciated.

`


#7

From @jayair on Mon May 15 2017 17:22:00 GMT+0000 (UTC)

@Hollow27 When you try the full command (with the client-id passed in), what is the error you are seeing?


#8

From @zohaibshahzadTO on Tue May 16 2017 23:24:04 GMT+0000 (UTC)

This is what I’m getting (kind of a noob using the terminal):
cmd555

Unknown output type: [None]

^thats what im getting when I try the full command with client-id passed in.


#9

From @jayair on Wed May 17 2017 16:56:44 GMT+0000 (UTC)

@Hollow27 Yeah I’m not too familiar with Windows. But @ryanjcruz is a Windows user. Maybe he can help you?


#10

From @ryanjcruz on Thu May 18 2017 08:28:20 GMT+0000 (UTC)

@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 admin@example.com \
–password Passw0rd! \
–user-attributes Name=email,Value=admin@example.com

then the last line shouldn’t have any as that should be the enter key needed to execute the command.


#11

From @jayair on Thu May 18 2017 17:42:43 GMT+0000 (UTC)

@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?


#12

From @ryanjcruz on Fri May 19 2017 07:48:53 GMT+0000 (UTC)

@jayair no probs, happy to help out.


#13

From @wilsonmar on Mon May 29 2017 11:16:54 GMT+0000 (UTC)

@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 admin1@jetbloom.com

The user-pool-id value I got from Pool details: Pool Id, above the Pool ARN.


#14

From @jayair on Mon May 29 2017 11:42:22 GMT+0000 (UTC)

@wilsonmar That’s a good idea. I’ll be adding sections to chapters with common errors people are getting.


#15

From @wilsonmar on Mon May 29 2017 14:58:56 GMT+0000 (UTC)

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 notifications@github.com 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
.


#16

From @fwang on Mon May 29 2017 21:16:22 GMT+0000 (UTC)

@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.


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

#17

From @wilsonmar on Tue May 30 2017 01:23:47 GMT+0000 (UTC)

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


I’ve forked, created branch 'Cognito-User-Pools-only-avail-US-East-1, and updated file as


#18

From @fwang on Wed May 31 2017 00:06:39 GMT+0000 (UTC)

Cognito User Pools were made available in us-west-2, US West (Oregon) later in 2016.

You shouldn’t be able to create the pool in the first place if it were not available.


#19

From @wilsonmar on Wed May 31 2017 07:33:40 GMT+0000 (UTC)

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 notifications@github.com 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
.


#20

From @fwang on Wed May 31 2017 22:41:10 GMT+0000 (UTC)

This should help - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html