8

I am using Aws Cognito and not able to find the solution for removing the Signup button from cognito login page.Thank you.

Cognito user pool provides the default login page with Forgot Password,signin and signup.But I want to hide/remove the Signup from that page.

6
  • Please elaborate what your problem is. Cognito User pool is a backend service offered by AWS for user management. You have to make front end for users. Where do you want to remove signup button from? Commented Feb 20, 2019 at 9:48
  • Is there any way to customize ui login screen? I'm planning to use aws provided login..
    – Ponni
    Commented Feb 21, 2019 at 11:56
  • Cognito does not provide any UI. You have to create your own UI and call cognito APIs. What are you using cognito on? Commented Feb 21, 2019 at 12:45
  • Going to use Login Page is from cognito and redirecting to another portal url for application. double time security check.
    – Ponni
    Commented Feb 22, 2019 at 4:49
  • 2
    @NinadGaikwad Thre times saying wrong info: "Cognito does not provide any UI". Cognito provides login UI and ways to customize it. Question clearly says "Login page". Login page is provided by Cognito service.
    – zdenko.s
    Commented Nov 20, 2021 at 5:23

5 Answers 5

25

In the AWS management console, go to Cognito, select your your user pool, then, under 'General Settings' / 'Policies' select option 'Only allow administrators to create users' (this deselects option 'Allow users to sign themselves up').

3
  • 1
    Yes, it's work. Can we hide Forgot your password? option? Commented Jun 20, 2019 at 7:03
  • Is there any way to enable this per client? (I want some clients to be able to sign up but not others)
    – Ignacio
    Commented Nov 1, 2021 at 23:44
  • @Ignacio I guess not. But you can create a custom ui on top of it and use amplify sdk to pass username and password. You can then customize the signup option based on the user logged in. Amplify provides you api to do so. Amplify Cognito Commented Mar 1, 2022 at 14:49
4

If you are using CloudFormation set AllowAdminCreateUserOnly to True like this:

resources:
  Resources:
    # Creates a User Pool
    CognitoUserPool:
      Type: AWS::Cognito::UserPool
      Properties:
        # Generate a name based on the stage
        UserPoolName: ${self:custom.stage}-user-pool
        # Set email as an alias
        UsernameAttributes:
          - email
        AutoVerifiedAttributes:
          - email
        # Case sensitivity on the username input for the selected sign-in option.
        UsernameConfiguration:
          CaseSensitive: false
        AdminCreateUserConfig:
          AllowAdminCreateUserOnly: True # This setting disables self sign-up for users
2

you can hide the forget password and signup text by making following changes in CSS template.css file. to download this css file go to your user pool -> app clients -> choose your app client -> Hosted UI customization -> edit -> above the csv upload button you can see the link fot cssTemplate.css file. dowload it and make following chanes. i.e. replace .redirect-customizable class code with following :-

.redirect-customizable {display:none;}

upload this new file and save the changes. refresh the login page. you can see forget pwd and signup text is not there. thanks :)

1

[In their documentation there is an area that shows how you can use just the signup, but I think its as simple as setting hideSignUp to true, but this is the link where it gives the sample code:

https://ui.docs.amplify.aws/react/connected-components/authenticator/configuration

At the bottom of the page is the code that describes how to remove sign up

 <Authenticator
  formFields={formFields}
  components={components}
  hideSignUp={true}
>
  {({ signOut, user }) => (
    <main>
      <h1>Hello {user.username}</h1>
      <button onClick={signOut}>Sign out</button>
    </main>
  )}
</Authenticator>

]1

This is also a way to hide the signup as well!

You can override the css with the below code to just hide any tabs on the authenticator

.amplify-tabs { 
   display: none;
}
1

Update for those using latest AWS management console UI:

  • Amazon Cognito
  • User pools
  • your-pool-id
  • Sign-up TAB

then disable the option inside "Self-service sign-up" panel

1
  • This did not work for me in local dev mode. I did an > amplify pull, and there is still a Create Account option in the withAuthenticator component. Commented Oct 23, 2023 at 2:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.