How to change background of aws amplify/cognito login/signup screen

Viewed 3253

I want to use aws amplify for an app I am making, but I can't figure out how to change the background of the login/sign up screens using withAuthenticator. Can someone please let me know how to do this? I just want an image background for now. Thanks!

3 Answers

To change the main background(not the login box background) from default grey on Amazon Cognito managed login version, you cannot do it in the pool management area, you have to use AWS CLI to do it.

I used the web-browser based one available in AWS called "Cloud Shell".

The following is an example. Make sure you specify region, user pool and client ID. You can get the client ID from the URL, the pool ID from the pool page.

You will also need to add a logo in Base64 format so pick your logo and use an online tool to convert your logo to a long base 64 string. If your string conversion starts with "data:image/png;base64," omit it and include all after the comma by also adding this to the command..

--image-file "long-base64-image-string-here".

`aws cognito-idp set-ui-customization --region eu-west-2 --user-pool-id "eu-west-2XXXX" --client-id "XXXXXXXXXXXX" --css "
body { background: red;} 
.submitButton-customizable{background-color:#c91265; border-color:#c91265;} 
.banner-customizable{background-color: white} 
.socialButton-customizable.google-button{background: #fafafa;color: #0d0707;}
.socialButton-customizable{border-radius: 10px;border: 1px #cacaca solid;}
socialButton-customizable.google-button .social-logo {border-radius:10px;}"`

enter image description here

You can also add background image like this

Related