Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (19.1k points)

I am trying to call adminInitiateAuth as follows:

var params = {

        AuthFlow: 'ADMIN_NO_SRP_AUTH',

        ClientId: 'xxxxxxxxx',

        UserPoolId: 'eu-west-1_xxxxxx',

        AuthParameters: {

            email: email,

            password: password



    var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider({apiVersion: '2016-04-18'});

    cognitoidentityserviceprovider.adminInitiateAuth(params, function(err, data) {

      if (err) {

            console.log(err, err.stack);

        } else {




But I am getting the following error:

TypeError: cognitoidentityserviceprovider.adminInitiateAuth is not a function

Any ideas what I am doing wrong here? Other functions such as signUp work when called in the same manner!

1 Answer

0 votes
by (44.4k points)

Check your version of NodeJS AWS SDK which is running on your Lambda function. Most probably it would be version 2.4.9.

console.log('SDK Version is ' + AWS.VERSION)

adminInitiateAuth was released with the version 2.4.11, so try adding the sdk manually:

npm install aws-sdk

Then you can Zip up your Lambda function file with the node_modules directory

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories