setUICustomization method
Configures UI branding settings for domains with the hosted UI (classic) branding version. Your user pool must have a domain. Configure a domain with .
Set the default configuration for all clients with a ClientId
of ALL. When the ClientId value is an app client
ID, the settings you pass in this request apply to that app client and
override the default ALL configuration.
Learn more
- Signing Amazon Web Services API Requests
- Using the Amazon Cognito user pools API and user pool endpoints
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotAuthorizedException.
May throw OperationNotEnabledException.
May throw ResourceNotFoundException.
May throw TooManyRequestsException.
Parameter userPoolId :
The ID of the user pool where you want to apply branding to the classic
hosted UI.
Parameter css :
A plaintext CSS file that contains the custom fields that you want to
apply to your user pool or app client. To download a template, go to the
Amazon Cognito console. Navigate to your user pool App clients tab,
select Login pages, edit Hosted UI (classic) style, and
select the link to CSS template.css.
Parameter clientId :
The ID of the app client that you want to customize. To apply a default
style to all app clients not configured with client-level branding, set
this parameter value to ALL.
Parameter imageFile :
The image that you want to set as your login in the classic hosted UI, as
a Base64-formatted binary object.
Implementation
Future<SetUICustomizationResponse> setUICustomization({
required String userPoolId,
String? css,
String? clientId,
Uint8List? imageFile,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.SetUICustomization'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'UserPoolId': userPoolId,
if (css != null) 'CSS': css,
if (clientId != null) 'ClientId': clientId,
if (imageFile != null) 'ImageFile': base64Encode(imageFile),
},
);
return SetUICustomizationResponse.fromJson(jsonResponse.body);
}