Search code examples
authenticationamazon-cognitoaws-amplifyaws-appsync

AWS amplify authentication, enable only sign in - not sign up


From all the great tutorials I looked for of how to add an auth module for a react app in amplify. The only type of module I see is a complete feature of sign in + sign up.

What I'm trying to achieve is:

  1. Set up a custom Cognito user pool and add users to the pool manually.
  2. Add custom sign-in/login UI + code to a react amplify app.
  3. Disable anyone but me to add new users to the Cognito user pool manually.

The website I'm working on is an internal website and I don't want anyone to be able to sign up via AppSync or the react client.

Please help :)


Solution

  • This won't be very difficult - you simply don't implement the front-end functionality to add a new user. Then, in your Cognito user pool config, there is an option User sign ups allowed? which you would set to Only administrators can create users.

    Edit: Also, consider using the hosted UI, it may save you some front-end work.