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.

Ponni
  • 433
  • 5
  • 17
  • 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? – Ninad Gaikwad Feb 20 '19 at 09:48
  • Is there any way to customize ui login screen? I'm planning to use aws provided login.. – Ponni Feb 21 '19 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? – Ninad Gaikwad Feb 21 '19 at 12:45
  • Going to use Login Page is from cognito and redirecting to another portal url for application. double time security check. – Ponni Feb 22 '19 at 04:49
  • But cognito does not provide any login pages. Post screenshot of what page you are talking about – Ninad Gaikwad Feb 22 '19 at 05:36
  • 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 Nov 20 '21 at 05:23

5 Answers5

24

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').

J.R.
  • 1,880
  • 8
  • 16
  • 1
    Yes, it's work. Can we hide `Forgot your password?` option? – Kushan Gunasekera Jun 20 '19 at 07:03
  • Is there any way to enable this per client? (I want some clients to be able to sign up but not others) – Ignacio Nov 01 '21 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](https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js/#sign-up) – Jithin Joseph Mar 01 '22 at 14:49
2

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
Marcin Rapacz
  • 616
  • 8
  • 12
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;
}
Briveloper
  • 11
  • 2
0

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

A. Masson
  • 2,287
  • 3
  • 30
  • 36