Skip to content

Commit e2f5c1e

Browse files
committed
[fix] README.md
1 parent a6df4ae commit e2f5c1e

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This example code demonstrates how to use AWS Cognito with AWS Go SDK in a form
1313
3. Verify user's phone
1414
4. Login with username or refresh token
1515

16-
In order this solution to work, you need to have AWS credentials configured (file `.aws/configuration` exists) and User Pool created in AWS Console. You have to disable "Remember device" and enable "Sms second-factor" on authentication tab.
16+
In order this solution to work, you need create User Pool in AWS Console. You have to disable "Remember device" and enable "Sms second-factor" on authentication tab.
1717

1818
When the app client is created, in it's settings select "Enable username-password (non-SRP) flow for app-based authentication (USER_PASSWORD_AUTH)".
1919

@@ -31,13 +31,24 @@ go build -o ./build/cognito
3131
Without client secret:
3232

3333
```go
34-
AWS_PROFILE=XXX COGNITO_APP_CLIENT_ID=XXX COGNITO_USER_POOL_ID=XXX PORT=8080 ./build/cognito
34+
AWS_REGION=XXX COGNITO_APP_CLIENT_ID=XXX COGNITO_USER_POOL_ID=XXX PORT=8080 ./build/cognito
3535
```
3636

3737
With client secret:
3838

3939
```go
40-
AWS_PROFILE=XXX COGNITO_APP_CLIENT_ID=XXX COGNITO_APP_CLIENT_SECRET=XXX COGNITO_USER_POOL_ID=XXX PORT=8080 ./build/cognito
40+
AWS_REGION=XXX COGNITO_APP_CLIENT_ID=XXX COGNITO_APP_CLIENT_SECRET=XXX COGNITO_USER_POOL_ID=XXX PORT=8080 ./build/cognito
41+
```
42+
43+
## Quick setup (bash)
44+
45+
```sh
46+
export AWS_REGION=xxxx
47+
export COGNITO_APP_CLIENT_ID=xxxxx
48+
export COGNITO_APP_CLIENT_SECRET=xxxxx
49+
export COGNITO_USER_POOL_ID=xxxxx
50+
export PORT=8080
51+
go run main.go
4152
```
4253

4354
It's worth noting that in production environment you should not pass client secrets this way because with adequate permissions it's possible to read environmental variables of a running process. Also if you call a command that way, secret hash will be stored in your shell history. You should keep those issues in mind and mitigate them in your enviroment.

0 commit comments

Comments
 (0)