updateIdentityProvider method
Updates identity provider information for a user pool.
May throw InvalidParameterException. May throw UnsupportedIdentityProviderException. May throw ResourceNotFoundException. May throw NotAuthorizedException. May throw TooManyRequestsException. May throw InternalErrorException.
Parameter providerName
:
The identity provider name.
Parameter userPoolId
:
The user pool ID.
Parameter attributeMapping
:
The identity provider attribute mapping to be changed.
Parameter idpIdentifiers
:
A list of identity provider identifiers.
Parameter providerDetails
:
The identity provider details to be updated, such as
MetadataURL
and MetadataFile
.
Implementation
Future<UpdateIdentityProviderResponse> updateIdentityProvider({
required String providerName,
required String userPoolId,
Map<String, String>? attributeMapping,
List<String>? idpIdentifiers,
Map<String, String>? providerDetails,
}) async {
ArgumentError.checkNotNull(providerName, 'providerName');
_s.validateStringLength(
'providerName',
providerName,
1,
32,
isRequired: true,
);
ArgumentError.checkNotNull(userPoolId, 'userPoolId');
_s.validateStringLength(
'userPoolId',
userPoolId,
1,
55,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.UpdateIdentityProvider'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ProviderName': providerName,
'UserPoolId': userPoolId,
if (attributeMapping != null) 'AttributeMapping': attributeMapping,
if (idpIdentifiers != null) 'IdpIdentifiers': idpIdentifiers,
if (providerDetails != null) 'ProviderDetails': providerDetails,
},
);
return UpdateIdentityProviderResponse.fromJson(jsonResponse.body);
}