amplify-js: Custom auth lambda trigger is not configured for the user pool.

Describe the bug

Using the Vue.js <amplify-sign-in> component, when attempting to log in with a blank password, I get the error “Custom auth lambda trigger is not configured for the user pool.”

image

To Reproduce Steps to reproduce the behavior:

Configure a Cognito user pool with just the email attribute required, and the OAuth 2.0 Authorization code grant flow. Scopes set to 'email', 'profile', 'openid'.

Expected behavior

An error message like “password is required”. Ideally, the form wouldn’t even submit.

Code Snippet Please provide a code snippet or a link to sample code of the issue you are experiencing to help us reproduce the issue. (Be sure to remove any sensitive data)

Screenshots If applicable, add screenshots to help explain your problem.

What is Configured?

Manual configuration:

const config = {
  Auth: {
    region: 'us-east-1',
    userPoolId: 'us-east-1_xxxxx', 
    userPoolWebClientId: 'xxxxxxxxxxxx',
    oauth: {
      scope: ['email', 'profile', 'openid'],
      redirectSignIn: 'http://localhost:8080',
      redirectSignOut: 'http://localhost:8080',
      responseType: 'code',
    },
  },
  Storage: {
    AWSS3: {
      bucket: 'xxxxxxxx',
      region: 'us-east-1',
    },
  },
};

export default config;
aws cognito-idp describe-user-pool --user-pool-id us-east-1_Nqtk7VOG7
{
    "UserPool": {
        "Id": "us-east-1_xxxxxxxxxxx",
        "Name": "xxxxxxxxx-UserPool",
        "Policies": {
            "PasswordPolicy": {
                "MinimumLength": 8,
                "RequireUppercase": false,
                "RequireLowercase": false,
                "RequireNumbers": false,
                "RequireSymbols": false,
                "TemporaryPasswordValidityDays": 7
            }
        },
        "LambdaConfig": {},
        "LastModifiedDate": 1586972919.04,
        "CreationDate": 1586950658.697,
        "SchemaAttributes": [
            {
                "Name": "sub",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": false,
                "Required": true,
                "StringAttributeConstraints": {
                    "MinLength": "1",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "name",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "given_name",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "family_name",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "middle_name",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "nickname",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "preferred_username",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "profile",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "picture",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "website",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "email",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": false,
                "Required": true,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "email_verified",
                "AttributeDataType": "Boolean",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false
            },
            {
                "Name": "gender",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "birthdate",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "10",
                    "MaxLength": "10"
                }
            },
            {
                "Name": "zoneinfo",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "locale",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "phone_number",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "phone_number_verified",
                "AttributeDataType": "Boolean",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false
            },
            {
                "Name": "address",
                "AttributeDataType": "String",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "StringAttributeConstraints": {
                    "MinLength": "0",
                    "MaxLength": "2048"
                }
            },
            {
                "Name": "updated_at",
                "AttributeDataType": "Number",
                "DeveloperOnlyAttribute": false,
                "Mutable": true,
                "Required": false,
                "NumberAttributeConstraints": {
                    "MinValue": "0"
                }
            }
        ],
        "AutoVerifiedAttributes": [
            "email"
        ],
        "UsernameAttributes": [
            "email"
        ],
        "VerificationMessageTemplate": {
            "DefaultEmailOption": "CONFIRM_WITH_CODE"
        },
        "MfaConfiguration": "OFF",
        "EstimatedNumberOfUsers": 2,
        "EmailConfiguration": {
            "EmailSendingAccount": "COGNITO_DEFAULT"
        },
        "UserPoolTags": {},
        "Domain": "xxxxxxxxxx",
        "AdminCreateUserConfig": {
            "AllowAdminCreateUserOnly": true,
            "UnusedAccountValidityDays": 7
        },
        "Arn": "arn:aws:cognito-idp:us-east-1:123456798012:userpool/us-east-1_xxxxxxxx"
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Hi, we have been aware of this issue and have this in our milestone. Currently, i guess this happens on sign-in component’s when there is no password. Right? There are password less sign in that disrupts the flow we have. I will keep you updated on this ticket as we progress.

one simple hack to it is telling the cognito that passwordless login is not permitted…we do it by going to aws cognito console’s app client and Enable username password based authentication (ALLOW_USER_PASSWORD_AUTH) which by default is not enabled…also we can set it in amplify.configure

For anyone interested, I was able to customize the error message like this:

import { I18n } from 'aws-amplify';

I18n.putVocabularies({
    fr: {
      'Custom auth lambda trigger is not configured for the user pool.': 'Veuillez renseigner le mot de passe',
    },
});

I wish this could be constants instead of strings, like for other translations in the new UI components version, but still a workaround. It still sends the request though, but at least displays a corresponding error.

managed to replace the text by

I18n.putVocabularies({
  en: {
    'Custom auth lambda trigger is not configured for the user pool.': 'Password cannot be empty',
  },
});

For anyone interested, I was able to customize the error message like this:

import { I18n } from 'aws-amplify';

I18n.putVocabularies({
    fr: {
      'Custom auth lambda trigger is not configured for the user pool.': 'Veuillez renseigner le mot de passe',
    },
});

I wish this could be constants instead of strings, like for other translations in the new UI components version, but still a workaround. It still sends the request though, but at least displays a corresponding error.

Same issue here - any updates on this?

Hey, is any progress on it?