【发布时间】:2016-10-30 23:47:20
【问题描述】:
我正在使用 javascript 创建和 lambda 函数,以使用 AWS Cognito 和身份池对用户进行身份验证。但我需要在我的 lambda 函数代码中包含以下 JS 库引用
aws-cognito-sdk.js
amazon-cognito-identity.min.js
aws-sdk.min.js"
moment.js
sjcl.js
jsbn.js
jsbn2.js
下面给出的是我在 lambda 函数的处理程序中使用的部分代码。如何在我的 lambda 函数代码中包含对上述 javascripts 的引用?
exports.handler = function(event, context, callback)
{
// Cognito Identity Pool Id
AWS.config.region = 'us-east-1';
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'us-east-1:xxxxxxxxxx',
});
// Cognito User Pool Id
AWSCognito.config.region = 'us-east-1';
AWSCognito.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'us-east-1:xxxxxxxx'
});
//...rest of the logic..
}
【问题讨论】:
标签: javascript node.js aws-lambda