Skip to content

Commit 01d0d5c

Browse files
authored
Merge branch 'awsdocs:main' into healthimage-update
2 parents de883d5 + 9f35f67 commit 01d0d5c

File tree

26 files changed

+7089
-0
lines changed

26 files changed

+7089
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "file://zonbook/docbookx.dtd" [
3+
<!ENTITY % phrases-shared SYSTEM "file://AWSShared/common/phrases-shared.ent">
4+
%phrases-shared;
5+
]>
6+
<block>
7+
<para>
8+
Shows web-based demo application that demonstrates &COG; identity
9+
pools authentication flows, allowing users to interactively explore both enhanced and
10+
basic authentication flows with various identity providers.
11+
</para>
12+
<para>For complete source code and instructions on how to set up and run, see the full example
13+
on <ulink
14+
url="https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/cognito/scenarios/identity_pools_example_demo">
15+
GitHub</ulink>.</para>
16+
</block>

.doc_gen/metadata/cross_metadata.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,3 +1005,18 @@ cross_MonitorDynamoDB:
10051005
services:
10061006
dynamodb:
10071007
cloudwatch:
1008+
cross_CognitoFlows:
1009+
title: Use &COG; identity pools and authentication flows
1010+
title_abbrev: Use &COG; identity pools
1011+
synopsis:
1012+
create a web-based demo application that demonstrates identity pools authentication flows.
1013+
category: Scenarios
1014+
languages:
1015+
Python:
1016+
versions:
1017+
- sdk_version: 3
1018+
github: python/example_code/cognito/scenarios/identity_pools_example_demo
1019+
block_content: cross_CognitoFlows_Python_block.xml
1020+
service_main: cognito-identity-provider
1021+
services:
1022+
cognito-identity-provider:

python/example_code/cognito/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Code examples that show you how to accomplish a specific task by calling multipl
6262
functions within the same service.
6363

6464
- [Sign up a user with a user pool that requires MFA](cognito_idp_actions.py)
65+
- [Use Amazon Cognito identity pools](../../example_code/cognito/scenarios/identity_pools_example_demo)
6566

6667

6768
<!--custom.examples.start-->
@@ -114,6 +115,18 @@ python cognito_idp_actions.py
114115
<!--custom.scenarios.cognito-identity-provider_Scenario_SignUpUserWithMfa.start-->
115116
<!--custom.scenarios.cognito-identity-provider_Scenario_SignUpUserWithMfa.end-->
116117

118+
#### Use Amazon Cognito identity pools
119+
120+
This example shows you how to create a web-based demo application that demonstrates identity pools authentication flows.
121+
122+
123+
<!--custom.scenario_prereqs.cross_CognitoFlows.start-->
124+
<!--custom.scenario_prereqs.cross_CognitoFlows.end-->
125+
126+
127+
<!--custom.scenarios.cross_CognitoFlows.start-->
128+
<!--custom.scenarios.cross_CognitoFlows.end-->
129+
117130
### Tests
118131

119132
⚠ Running tests might result in charges to your AWS account.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FRONTEND_URL=http://localhost:8001
2+
3+
# Amazon Cognito configuration: replace these example values with your actual AWS configuration
4+
AWS_REGION=us-east-1
5+
AWS_ACCOUNT_ID=123456789012
6+
7+
# Amazon Cognito identity pools configuration: replace with your actual identity pool ID from the Amazon Cognito console
8+
COGNITO_IDENTITY_POOL_ID=us-east-1:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
9+
10+
# IAM role ARN for authenticated users: it grants permissions to users who have signed in
11+
AUTHENTICATED_ROLE_ARN=arn:aws:iam::123456789012:role/Cognito_IdentityPoolAuth_Role
12+
# IAM role ARN for unauthenticated users: it grants limited permissions to anonymous users
13+
UNAUTHENTICATED_ROLE_ARN=arn:aws:iam::123456789012:role/Cognito_IdentityPoolUnauth_Role
14+
15+
# Amazon Cognito user pool configuration
16+
COGNITO_USER_POOL_ID=us-east-1_EXAMPLE123
17+
COGNITO_APP_CLIENT_ID=1234567890abcdefEXAMPLE
18+
COGNITO_APP_CLIENT_SECRET=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0tEXAMPLE
19+
COGNITO_DOMAIN=example-domain
20+
21+
# Social identity providers: configure the social identity providers you want to use
22+
# 1. Google OAuth 2.0 configuration: obtain these values from the Google Cloud Console
23+
GOOGLE_CLIENT_ID=123456789012-abcdefghijklmnopqrstuvwxyzEXAMPLE.apps.googleusercontent.com
24+
GOOGLE_CLIENT_SECRET=GOCSPX-AbCdEfGhIjKlMnOpQrStUvWxYzEXAMPLE
25+
26+
# 2. Facebook login configuration: obtain these values from Facebook for developers
27+
FACEBOOK_APP_ID=1234567890123456
28+
FACEBOOK_APP_SECRET=a1b2c3d4e5f6g7h8i9j0k1l2m3n4oEXAMPLE
29+
30+
# 3. Login with Amazon configuration: obtain these values from the Amazon Developer Portal
31+
AMAZON_CLIENT_ID=amzn1.application-oa2-client.a1b2c3d4e5f6g7h8i9j0k1l2m3n4oEXAMPLE
32+
AMAZON_CLIENT_SECRET=amzn1.oa2-cs.v1.a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5zEXAMPLE
33+
34+
# Enterprise identity providers: configure enterprise identity providers for corporate authentication
35+
# 1. OpenID Connect (OIDC) provider configuration: replace with your OIDC provider's configuration
36+
37+
# For Okta, these would typically be:
38+
# OIDC_AUTHORIZATION_ENDPOINT=https://your-domain.okta.com/oauth2/default/v1/authorize
39+
# OIDC_TOKEN_ENDPOINT=https://your-domain.okta.com/oauth2/default/v1/token
40+
41+
# # For Auth0, these would typtically be:
42+
# OIDC_AUTHORIZATION_ENDPOINT=https://your-domain.us.auth0.com/authorize
43+
# OIDC_TOKEN_ENDPOINT=https://your-domain.us.auth0.com/oauth/token
44+
45+
OIDC_CLIENT_ID=oidc_client_1234567890abcdefEXAMPLE
46+
OIDC_CLIENT_SECRET=oidc_secret_a1b2c3d4e5f6g7h8i9j0k1l2m3n4oEXAMPLE
47+
OIDC_AUTHORIZATION_ENDPOINT=https://your-oidc-provider.com/oauth2/authorize
48+
OIDC_TOKEN_ENDPOINT=https://your-oidc-provider.com/oauth2/token
49+
OIDC_ISSUER=https://your-oidc-provider.com
50+
51+
# 2. SAML 2.0 provider configuration: replace with your SAML provider's configuration
52+
# For Okta SAML, these would typically be:
53+
# OKTA_DOMAIN=your-domain.okta.com
54+
# OKTA_APP_ID=exkABCDEF123456789
55+
SAML_SSO_URL=https://example.com/saml/sso
56+
SAML_ENTITY_ID=urn:amazon:cognito:sp:us-east-1:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
57+
SAML_PROVIDER=ExampleSAMLProvider
58+
SAML_PROVIDER_ARN=arn:aws:iam::123456789012:saml-provider/ExampleSAMLProvider
59+
60+
# Custom developer provider configuration: replace with your custom developer provider name
61+
DEVELOPER_PROVIDER_NAME=ExampleDeveloperProvider
62+
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
63+
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

0 commit comments

Comments
 (0)