I’m attempting to retrieve a client ID from an AWS Cognito User Pool based on a matching Hosted URL using the AWS CLI. For example, let’s say I have a Hosted URL https://example3.com, and I want to find the corresponding client ID associated with it. I’m using the aws cognito-idp list-user-pool-clients command with the –output json option.
How can I filter the output to only return the client ID if the Hosted URL matches the provided one? Any assistance or examples would be greatly appreciated. Thank you!
Cmd :
$hostedurl = "https://localhost.com"
aws cognito-idp list-user-pool-clients --user-pool-id us_east_1dg****** --query "UserPoolClients[?contains(CallbackURLs, $hostedurl)]"
sirishrayaprolu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.