[英]Amazon Lambda function and Cognito : Add new user in existing user pool using a lambda function
I would know if we can create a lambda function to add a new user to a specific user pool, if yes have you any example that explain which role to create for this lambda function using nodeJs?. I would know if we can create a lambda function to add a new user to a specific user pool, if yes have you any example that explain which role to create for this lambda function using nodeJs?.
If i understood your question correctly follow these steps:如果我正确理解了您的问题,请按照以下步骤操作:
Create new user code example:创建新的用户代码示例:
const aws = require('aws-sdk');
const cognito = new aws.CognitoIdentityServiceProvider();
const params = {
ClientId: "The ID of the client associated with the user pool",
Username: "My Username",
Password: "My Password",
};
cognito.signUp(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.