getIdentityProviderByIdentifier method

Future<GetIdentityProviderByIdentifierResponse> getIdentityProviderByIdentifier({
  1. required String idpIdentifier,
  2. required String userPoolId,
})

Given the identifier of an identity provider (IdP), for example examplecorp, returns information about the user pool configuration for that IdP. For more information about IdPs, see Third-party IdP sign-in.

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

Parameter idpIdentifier : The identifier that you assigned to your user pool. The identifier is an alternative name for an IdP that is distinct from the IdP name. For example, an IdP with a name of MyIdP might have an identifier of the email domain example.com.

Parameter userPoolId : The ID of the user pool where you want to get information about the IdP.

Implementation

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

  return GetIdentityProviderByIdentifierResponse.fromJson(jsonResponse.body);
}