Using a custom UI with amazon cognito

Viewed 4856

I am making a portfolio-building app by hosting reactjs on cloudfront and using serverless lambda as the backend. I want to have authentication, but I want to really be able to customize the login/sign up page with react. Is there a way to do this with Cognito, or is there some other technology I should use? What are my options in this regard? Thanks!

2 Answers

Based on my experience it's possible to implement a custom UI as part of your application self.

You can implement your custom view in React and then handle all the signIn/signUp/signOut calls using the Amplify lib

The Cognito Hosted UI cannot be customized beyond some custom styles and a custom logo that you're able to configure in the AWS web console.

If you don't need to rely on the Oauth2 features provided by the hosted UI you can have a look at the AWS Amplify project that provides React components for authentication with Cognito. But as I said, if you need the Oauth2 flows in your login pages then the hosted UI is, unfortunately, the only solution as AWS doesn't provide an API for Oauth2.

Related