# Create a Cognito Test User

**URL:** <https://discourse.sst.dev/t/create-a-cognito-test-user/126>\
**Category:** Chapter Comments\
**Created:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126 "2018-05-09T19:46:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/1 "2018-05-09T19:46:47Z")

</div>

_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](http://serverless-stack.com/chapters/create-a-cognito-test-user.html)  
  
_Copied from original issue: [https://github.com/AnomalyInnovations/serverless-stack-com/issues/18](https://github.com/AnomalyInnovations/serverless-stack-com/issues/18)_

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/2 "2018-05-09T19:46:49Z")

</div>

_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)

```auto
$ 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** _

```

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/3 "2018-05-09T19:46:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/4 "2018-05-09T19:46:50Z")

</div>

_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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/5 "2018-05-09T19:46:50Z")

</div>

_From @jayair on Fri Apr 14 2017 22:52:28 GMT+0000 (UTC)_  
  
Added it to the chapter - 562b54b252423011d418e16aed20083d403c4b18

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/6 "2018-05-09T19:46:50Z")

</div>

_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](mailto:admin@example.com)   
> –password Passw0rd!   
> –user-attributes [Name=email,Value=admin@example.com](mailto: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](https://yyz2.discourse-cdn.com/flex032/uploads/serverless_stack/original/1X/a57b5f21dc0fbbd5ce98355c1e22d7c966ad4dea.JPG)

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

`

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/7 "2018-05-09T19:46:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/8 "2018-05-09T19:46:51Z")

</div>

_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](https://canada1.discourse-cdn.com/flex032/uploads/serverless_stack/original/1X/76defacfd3aeeae0def6c94365d0e10f7933e712.JPG)

**Unknown output type: [None]**

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/9 "2018-05-09T19:46:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/10 "2018-05-09T19:46:51Z")

</div>

_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](mailto:admin@example.com) \  
–password Passw0rd! \  
–user-attributes [Name=email,Value=admin@example.com](mailto: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.

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/11 "2018-05-09T19:46:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/12 "2018-05-09T19:46:52Z")

</div>

_From @ryanjcruz on Fri May 19 2017 07:48:53 GMT+0000 (UTC)_  
  
@jayair no probs, happy to help out.

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/13 "2018-05-09T19:46:53Z")

</div>

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

```auto
{
    "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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/14 "2018-05-09T19:46:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/15 "2018-05-09T19:46:53Z")

</div>

_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](mailto:notifications@github.com) wrote:

> @wilsonmar [https://github.com/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](https://github.com/AnomalyInnovations/serverless-stack-com/issues/18#issuecomment-304641293),  
> or mute the thread  
> [https://github.com/notifications/unsubscribe-auth/AASUDo0eKEjL1QEHzr9m9Plf-YRKHxdIks5r-q8egaJpZM4M4OAz](https://github.com/notifications/unsubscribe-auth/AASUDo0eKEjL1QEHzr9m9Plf-YRKHxdIks5r-q8egaJpZM4M4OAz)  
> .

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/16 "2018-05-09T19:46:54Z")

</div>

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

> **[Create an IAM User](https://serverless-stack.com/chapters/create-an-iam-user.html)**
>
> To interact with AWS using some command line tools we need to create an IAM user through the AWS console.

  

> **[Configure the AWS CLI](https://serverless-stack.com/chapters/configure-the-aws-cli.html)**
>
> To interact with AWS using the command line we need to install the AWS command line interface (or AWS CLI). It also needs to be configured with our IAM user Access key ID and Secret Access key from the AWS console.

At the end of the day, you should have a file at `~/.aws/credentials` look similar to

```auto
[default]
aws_access_key_id = AKXXXXXXXXXXXXXXXXMQ
aws_secret_access_key = JOsGrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc132

```

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/17 "2018-05-09T19:46:54Z")

</div>

_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](https://forums.aws.amazon.com/thread.jspa?messageID=722312)

Since the first mention of region is at

> **[Create an S3 Bucket for File Uploads](https://serverless-stack.com/chapters/create-an-s3-bucket-for-file-uploads.html)**
>
> To allow users to upload files to our serverless app we are going to use Amazon S3 (Simple Storage Service). S3 allows you to store files and organize them into buckets. We are going to create an S3 bucket and enable CORS (cross-origin resource...

  
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>

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/18 "2018-05-09T19:46:55Z")

</div>

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

> **[Amazon Cognito Your User Pools – Now Generally Available | Amazon Web Services](https://aws.amazon.com/blogs/aws/amazon-cognito-your-user-pools-now-generally-available/)**
>
> A few months ago I wrote about the new Your User Pools feature for Amazon Cognito. As I wrote at the time, you can use this feature to easily add user sign-up and sign-in to your mobile and web apps. The fully managed user directories can scale to...

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

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/19 "2018-05-09T19:46:55Z")

</div>

_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](mailto: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-](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](https://github.com/AnomalyInnovations/serverless-stack-com/issues/18#issuecomment-305043666),  
> or mute the thread  
> [https://github.com/notifications/unsubscribe-auth/AASUDr2pQlurB5T7Wn1GGU6pgkzKI5ETks5r\_K8QgaJpZM4M4OAz](https://github.com/notifications/unsubscribe-auth/AASUDr2pQlurB5T7Wn1GGU6pgkzKI5ETks5r_K8QgaJpZM4M4OAz)  
> .

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 7:46pm UTC](https://discourse.sst.dev/t/create-a-cognito-test-user/126/20 "2018-05-09T19:46:55Z")

</div>

_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](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)

[Next page](https://discourse.sst.dev/t/create-a-cognito-test-user/126.md?page=2)
