1

There is a SO question [How to remove signup in login page][1] and it addresses CF. In case of Amplify, CF template is generated by backend-config.json

  "auth": {
    "usermanager": {
      "service": "Cognito",
      "serviceType": "managed",
      "providerPlugin": "awscloudformation",
     }
   }

How to configure Amplify template to generate CF template with property?

AdminCreateUserConfig:
          AllowAdminCreateUserOnly: True

Link to Amplify templeate reference would be appreciated.

Edit: Amplify supports overriding generated content. I run amplify override auth. It generated file amplify\backend\auth\myusermanager\override.ts. I did one override:

import { AmplifyAuthCognitoStackTemplate } from '@aws-amplify/cli-extensibility-helper';

export function override(resources: AmplifyAuthCognitoStackTemplate) {
    resources.userPool.adminCreateUserConfig = {
        allowAdminCreateUserOnly: true,
    }
}

Generated CF template looks OK

  "Resources": {
    "UserPool": {
      "Type": "AWS::Cognito::UserPool",
      "Properties": {
        "AdminCreateUserConfig": {
          "AllowAdminCreateUserOnly": true
        },

Regardless of it, Sign in link is present on login page.
When I check Cognito user pool policy, I find Only allow administrators to create users radio button selected.

EDIT Suggested answer relates to VUE. I am using React.
"@aws-amplify/ui-react": "^2.1.0"
[1]: AWS Cognito-remove signup in login page

zdenko.s
  • 931
  • 1
  • 12
  • 29
  • Does this answer your question? [How do I disable the sign up link for the aws amplify vue authenticator?](https://stackoverflow.com/questions/60045960/how-do-i-disable-the-sign-up-link-for-the-aws-amplify-vue-authenticator) – shimo Nov 20 '21 at 06:41
  • It looks to me overkilling. Amplify allows "overriding" CF template generation. I edited question – zdenko.s Nov 20 '21 at 08:38
  • Actually, it works. I tried to signup new user and got error: "SignUp is not permitted for this user pool". I was expecting that Sign up link will not be shown on login dialog. It is usability question. Login dialog should be created based on Cognito settings. – zdenko.s Nov 20 '21 at 19:18

0 Answers0