describeResourceServer method

Future<DescribeResourceServerResponse> describeResourceServer({
  1. required String identifier,
  2. required String userPoolId,
})

Describes a resource server. For more information about resource servers, see Access control with resource servers.

May throw InternalErrorException. May throw InvalidParameterException. May throw NotAuthorizedException. May throw OperationNotEnabledException. May throw ResourceNotFoundException. May throw TooManyRequestsException.

Parameter identifier : A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

Parameter userPoolId : The ID of the user pool that hosts the resource server.

Implementation

Future<DescribeResourceServerResponse> describeResourceServer({
  required String identifier,
  required String userPoolId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.DescribeResourceServer'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Identifier': identifier,
      'UserPoolId': userPoolId,
    },
  );

  return DescribeResourceServerResponse.fromJson(jsonResponse.body);
}