From 82a44ea4c087d189b752745d84edde2e4e2e1476 Mon Sep 17 00:00:00 2001 From: afaq <45089292+afaq1337@users.noreply.github.com> Date: Mon, 4 Aug 2025 23:56:55 +0500 Subject: [PATCH] Updated Cognito Identity CLI Command Format Replaced outdated key=value syntax with JSON-based in "--logins" format, keeping the old format for preserved legacy. --- .../cognito-identity-pools.md | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/pentesting-cloud/aws-security/aws-services/aws-cognito-enum/cognito-identity-pools.md b/src/pentesting-cloud/aws-security/aws-services/aws-cognito-enum/cognito-identity-pools.md index 2b8d27874..7f5fd1845 100644 --- a/src/pentesting-cloud/aws-security/aws-services/aws-cognito-enum/cognito-identity-pools.md +++ b/src/pentesting-cloud/aws-security/aws-services/aws-cognito-enum/cognito-identity-pools.md @@ -167,22 +167,36 @@ For this you might need to have access to the **identity provider**. If that is Anyway, the **following example** expects that you have already logged in inside a **Cognito User Pool** used to access the Identity Pool (don't forget that other types of identity providers could also be configured). -
aws cognito-identity get-id \
-    --identity-pool-id  \
-    --logins cognito-idp..amazonaws.com/=
+

+# Updated format
+aws cognito-identity get-id \
+  --identity-pool-id  \
+  --logins '{"cognito-idp..amazonaws.com/": ""}'
 
-# Get the identity_id from the previous commnad response
 aws cognito-identity get-credentials-for-identity \
-    --identity-id  \
-    --logins cognito-idp..amazonaws.com/=
+  --identity-id  \
+  --logins '{"cognito-idp..amazonaws.com/": ""}'
 
-
-# In the IdToken you can find roles a user has access because of User Pool Groups
-# User the --custom-role-arn to get credentials to a specific role
 aws cognito-identity get-credentials-for-identity \
-    --identity-id  \
-    --custom-role-arn  \
-    --logins cognito-idp..amazonaws.com/=
+  --identity-id  \
+  --custom-role-arn  \
+  --logins '{"cognito-idp..amazonaws.com/": ""}'
+
+ +> **Deprecated format** — these may no longer work with current AWS CLI: +

+aws cognito-identity get-id \
+  --identity-pool-id  \
+  --logins cognito-idp..amazonaws.com/=
+
+aws cognito-identity get-credentials-for-identity \
+  --identity-id  \
+  --logins cognito-idp..amazonaws.com/=
+
+aws cognito-identity get-credentials-for-identity \
+  --identity-id  \
+  --custom-role-arn  \
+  --logins cognito-idp..amazonaws.com/=
 
> [!WARNING]