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 {
console.log(data);
}
});
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!