Use DescribeUserPoolClient with an AWS SDK or CLI - Amazon Cognito
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

Use DescribeUserPoolClient with an AWS SDK or CLI

The following code examples show how to use DescribeUserPoolClient.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code examples:

CLI
AWS CLI

To describe a user pool client

This example describes a user pool client.

Command:

aws cognito-idp describe-user-pool-client --user-pool-id us-west-2_aaaaaaaaa --client-id 38fjsnc484p94kpqsnet7mpld0

Output:

{ "UserPoolClient": { "UserPoolId": "us-west-2_aaaaaaaaa", "ClientName": "MyApp", "ClientId": "38fjsnc484p94kpqsnet7mpld0", "ClientSecret": "CLIENT_SECRET", "LastModifiedDate": 1548108676.163, "CreationDate": 1548108676.163, "RefreshTokenValidity": 30, "ReadAttributes": [ "address", "birthdate", "custom:CustomAttr1", "custom:CustomAttr2", "email", "email_verified", "family_name", "gender", "given_name", "locale", "middle_name", "name", "nickname", "phone_number", "phone_number_verified", "picture", "preferred_username", "profile", "updated_at", "website", "zoneinfo" ], "WriteAttributes": [ "address", "birthdate", "custom:CustomAttr1", "custom:CustomAttr2", "email", "family_name", "gender", "given_name", "locale", "middle_name", "name", "nickname", "phone_number", "picture", "preferred_username", "profile", "updated_at", "website", "zoneinfo" ], "ExplicitAuthFlows": [ "ADMIN_NO_SRP_AUTH", "USER_PASSWORD_AUTH" ], "AllowedOAuthFlowsUserPoolClient": false } }
Python
SDK for Python (Boto3)
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

def describe_user_pool_client( self, user_pool_id: str, client_id: str ) -> dict[str, Any]: """ Describes an app client in a user pool, including the client secret. :param user_pool_id: The ID of the user pool that contains the app client. :param client_id: The ID of the app client to describe. :return: A dictionary with the app client configuration. """ try: response = self.cognito_idp_client.describe_user_pool_client( UserPoolId=user_pool_id, ClientId=client_id ) client_info = response.get("UserPoolClient", dict()) logger.info( "Described app client %s in user pool %s.", client_id, user_pool_id, ) return client_info except ClientError as err: if err.response["Error"]["Code"] == "ResourceNotFoundException": logger.error( "The user pool %s or client %s does not exist. " "Verify the stack deployed successfully and the outputs are correct.", user_pool_id, client_id, ) raise

For a complete list of AWS SDK developer guides and code examples, see Using this service with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.