如何在节点js中authenticationCognito用户池
在下面的nodeapp中使用v1.10的amazon-cognito-identity-js。
我已经写下了以下内容:这个电话是在用户注册被确认并且电子邮件已经被validation之后进行的。
var AWS = require('aws-sdk'); var AWSCognito = require('amazon-cognito-identity-js'); router.post('/emailsignin', function(req, res, next) { var email = req.body.email; var pwd = req.body.password; AWS.config.region = 'eu-west-1'; var poolData = { UserPoolId : AWS_USERPOOLID, ClientId : AWS_APPCLIENTID }; var userPool = new AWS.CognitoIdentityServiceProvider.CognitoUserPool(poolData); var authenticationData = { Username : email, Password : pwd, }; var authenticationDetails = new AWS.CognitoIdentityServiceProvider.AuthenticationDetails(authenticationData); var userData = { Username : email, Pool : userPool }; var cognitoUser = new AWS.CognitoIdentityServiceProvider.CognitoUser(userData); cognitoUser.authenticateUser(authenticationDetails, { onSuccess: function (result) { }, onFailure: function(err) { } });
当authenticateUser被调用时,我得到“ReferenceError:导航器没有定义”
它看起来像一个浏览器调用正在试图在节点服务器内。
我已经创build了一个github的问题,build议引用“jsbn”:“^ 0.1.0”,“sjcl”:“^ 1.0.3”,“amazon-cognito-identity-js”:“^ 1.10 .0“,”aws-sdk“:”^ 2.5.3“
我对包版本进行了更改。 不幸的是,这也不适用于此。 我创build了一个示例nodejs应用程序,尝试使用电子邮件ID和密码进行身份validation。
注意:Cognito池设置为电子邮件作为别名。 用户已被创build,确认并通过电子邮件validation。
源回购: https : //github.com/prem911/cognito-nodejs
任何指针如何解决“导航未find”?
- AWS IOT节点sdk为listThings和createThing提供了ResourceNotFoundException
- AWS Elastic Cache是否支持Redis集群上的Pub / Sub?
- 亚马逊Mechanical Turk资格考试要求
- 将项目放在使用适用于Node.js的AWS开发工具包的DynamoDB表上
- 如何将node.js日志从Elastic Beanstalk Docker应用程序发送到Cloudwatch Logs?
- 使用Amazon s3上的节点备份文件
- 在AWS上使用Rserve在Node.js和R之间进行跨平台通信时出错。 错误:连接ETIMEDOUT
- 使用Node和Node-gyp的AWS Lambda上的奇怪“内存”行为
- 开发亚马逊Alexa的技能,我有插槽值(首字母缩略词)阅读为单词的麻烦