listUserPoolClientSecrets method

Future<ListUserPoolClientSecretsResponse> listUserPoolClientSecrets({
  1. required String clientId,
  2. required String userPoolId,
  3. String? nextToken,
})

Lists all client secrets associated with a user pool app client. Returns metadata about the secrets. The response does not include pagination tokens as there are only 2 secrets at any given time and we return both with every ListUserPoolClientSecrets call. For security reasons, the response never reveals the actual secret value in ClientSecretValue.

May throw InternalServerException. May throw InvalidParameterException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw TooManyRequestsException.

Parameter clientId : The ID of the app client whose secrets you want to list.

Parameter userPoolId : The ID of the user pool that contains the app client.

Parameter nextToken : This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.

Implementation

Future<ListUserPoolClientSecretsResponse> listUserPoolClientSecrets({
  required String clientId,
  required String userPoolId,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSCognitoIdentityProviderService.ListUserPoolClientSecrets'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClientId': clientId,
      'UserPoolId': userPoolId,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListUserPoolClientSecretsResponse.fromJson(jsonResponse.body);
}