How do I turn off "sign up" in AWS Cognito's hosted UI without disabling self-registration?

Viewed 617

We have a native app and an Alexa skill. You can't use the Alexa skill without the app and you need to have your app account first. Some users are creating accounts with the Alexa skill that aren't linked with their app accounts.

We can disable self-registration and the sign-up link goes away in the hosted UI, but it also prevents account creation from the application using Amplify.

I looked at the hosted UI customization CSS to see if I could style that link to hide it, but the CSS customizations don't seem to address that link specifically. I'd like to avoid reinventing the entire auth wheel just to get rid of that one link.

Is there any way to disable the "sign up" link in the Cognito hosted UI without disabling self-registration?

Thanks!

2 Answers

You have 2 options as far as I know.

  1. Use custom lambda trigger on signup to reject calls made from your hosted UI
  2. Use your own login page instead of hosted UI.

Unfortunately, there is no way to modify the contents of the UI. You can only change the CSS and add a logo. The first method is easier but is a bad implementation because you are confusing your users with a button to register but then rejecting all their attempts. Second method is the best way to achieve what you want.

Another method is to use the adminCreateUser function, give it a temporary password and suppress email sending of the temporary password. Then do adminSetUserPassword to give the user the desired permanent password.

This technique seems to work properly when the "Enable signup" feature is disabled.

Related