Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromonaco committed Jul 16, 2023
1 parent 44c6f20 commit 2009ab7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
18 changes: 9 additions & 9 deletions src/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"state": {
"type": "markdown",
"state": {
"file": "APIs/GitHub API.md",
"file": "Cloud/AWS/Cognito.md",
"mode": "source",
"source": false
}
Expand Down Expand Up @@ -170,7 +170,7 @@
"state": {
"type": "backlink",
"state": {
"file": "APIs/GitHub API.md",
"file": "Cloud/AWS/Cognito.md",
"collapseAll": true,
"extraContext": true,
"sortOrder": "alphabetical",
Expand All @@ -187,7 +187,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "APIs/GitHub API.md",
"file": "Cloud/AWS/Cognito.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -210,7 +210,7 @@
"state": {
"type": "outline",
"state": {
"file": "APIs/GitHub API.md"
"file": "Cloud/AWS/Cognito.md"
}
}
},
Expand Down Expand Up @@ -241,12 +241,13 @@
},
"active": "418ab84c808d127b",
"lastOpenFiles": [
"APIs/Google Calendar API.md",
"APIs/GitHub API.md",
"APIs",
"Cloud/AWS/Index.md",
"Cloud/AWS/Moto.md",
"Cloud/AWS/Cognito.md",
"Cloud/AWS/Index.md",
"Tools/Docker Desktop.md",
"APIs/GitHub API.md",
"APIs/Google Calendar API.md",
"APIs",
"Cloud/Azure/Index.md",
"Cloud/Azure",
"Cloud/AWS",
Expand All @@ -270,7 +271,6 @@
"Management/Hiring.md",
"Management/Leadership.md",
"Management/Management.md",
"Management/Metrics.md",
"Frontend",
"How-to/Git",
"How-to/Powershell",
Expand Down
29 changes: 17 additions & 12 deletions src/Cloud/AWS/Cognito.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
```
aws --endpoint-url=http://localhost:52007 cognito-idp create-user-pool --pool-name "localcloud"
aws --endpoint-url=http://localhost:52007 cognito-idp list-user-pools --max-results 20
```
**Tag: #Cognito**

Execute `POST http://localhost:52009/moto-api/seed?a=42` to ensure the resulting state will always be the same.

Copy user pool id

```
aws --endpoint-url=http://localhost:52007 cognito-idp create-user-pool-client --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --client-name msnotification --generate-secret
```
aws --endpoint-url=http://localhost:52009 cognito-idp create-user-pool --pool-name "LocalDev"
aws --endpoint-url=http://localhost:52009 cognito-idp create-user-pool-client --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --client-name msnotification --generate-secret
Copy Client Id
aws --endpoint-url=http://localhost:52009 cognito-idp admin-create-user --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser"
aws --endpoint-url=http://localhost:52009 cognito-idp admin-set-user-password --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser" --password "L0c4lD3v" --permanent
aws --endpoint-url=http://localhost:52009 cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=testuser,PASSWORD=L0c4lD3v --client-id 71hfe86y5r215dew1zcyqesh0a --region ap-southeast-2
```
aws --endpoint-url=http://localhost:52007 cognito-idp admin-create-user --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser"

aws --endpoint-url=http://localhost:52007 cognito-idp admin-set-user-password --user-pool-id "ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5" --username "testuser" --password "Hum4nF0rc3!" --permanent

aws --endpoint-url=http://localhost:52007 cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=testuser,PASSWORD=Hum4nF0rc3! --client-id {INSERT_NEW_CLIENTID} --region ap-southeast-2
```
### Troubleshoot

```
aws --endpoint-url=http://localhost:52009 cognito-idp list-user-pools
aws --endpoint-url=http://localhost:52009 cognito-idp list-user-pool-clients --user-pool-id ap-southeast-2_366f47d5c8fd1bbefcf3afec577af68d09ebfa7d5
```
8 changes: 8 additions & 0 deletions src/Cloud/AWS/Moto.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
[Recorder](https://docs.getmoto.org/en/latest/docs/configuration/recorder/index.html)
[Run using Docker](http://docs.getmoto.org/en/latest/docs/server_mode.html#run-using-docker)

#Docker container: https://hub.docker.com/r/motoserver/moto

`docker run -p 52009:3000 -e MOTO_COGNITO_IDP_USER_POOL_ID_STRATEGY=HASH -e MOTO_ENABLE_RECORDING=True motoserver/moto:latest`


#Cognito http://docs.getmoto.org/en/latest/docs/services/cognito-idp.html

0 comments on commit 2009ab7

Please sign in to comment.