Generate Estimate Links for your program
Here’s a cleaner and more structured version of the steps you provided for interacting with the Cognito Identity Pool and making an API request:
Environment
Identity Pool ID
Production
us-east-1:50d520ef-0cd0-45c6-8798-33e0163fcde7
Sandbox
us-east-1:16a18d1f-dab5-4b76-a836-3ed99a37afd9
Step 1: Get an Unauthenticated Identity ID
Use the aws cognito-identity get-id
command to retrieve an unauthenticated identity ID from the identity pool.
Command:
Step 2: Exchange Identity ID for an OpenID Token
Use the aws cognito-identity get-open-id-token
command to exchange the identity ID for an OpenID token.
Command:
The response will include a Token
value. This token is valid for approximately 10 minutes.
Step 3: Use the OpenID Token to Make an API Request
Include the Token
value as the Authorization
header in your API request.
Command:
The OpenID token is valid for ~10 minutes. Ensure to refresh it as needed.
Replace the Identity Pool ID
and API endpoint according to your environment:
Sandbox: us-east-1:16a18d1f-dab5-4b76-a836-3ed99a37afd9
Production: us-east-1:50d520ef-0cd0-45c6-8798-33e0163fcde7