2016-03-06 257 views
1

我使用Node.js SDK连接Raspberry PiAWS IoT以下this tutorial。我看到vim ~/.aws/credentialsAWS缺失身份验证令牌

[default] 
aws_access_key_id = SOMETHING 
aws_secret_access_key = SOMETHINGELSE 

当我输入命令aws iot describe-endpoint我得到如下回应如下:

{ 
    "endpointAddress": "A34SXNTM6AT7XH.iot.us-west-2.amazonaws.com" 
} 

然而,当我浏览到网址:https://a34sxntm6at7xh.iot.us-west-2.amazonaws.com/ 我收到以下错误:

Missing Authentication Token 

enter image description here

任何想法可能是什么错误,如何解决?

enter image description here

enter image description here

这里是在~/certs文件夹中的文件:

[email protected]:~/certs $ ls 
certificate.pem.crt private.pem.key public.pem.key root-CA.pem 

回答

2

蒙娜丽莎,

您的自定义端点响应两个协议:MQTT和HTTPS。但是,它不提供任何网页内容,因此在浏览器中不能用作网站URL。您从aws iot describe-endpoint获得的“endpointAddress”将被插入到您链接的Raspberry Pi示例中使用的Node.js Device SDK中(不是https://)。

您也可以使用端点的HTTPS版本的签署在这里进行AWS签名版本4.更多请求装置阴影接口:http://docs.aws.amazon.com/iot/latest/developerguide/thing-shadow-rest-api.html在这里:http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html虽然你可能会得到通过使用AWS CLI或会更快AWS SDK执行此类操作。

瑞安@ AWS

+3

很高兴看到门票可以从AWS的工作人员直接回答。 – BMW

+0

嗨瑞安,这是否意味着考虑到我已经成功完成了教程中的所有步骤,这个“缺失的身份验证令牌”应该被忽略? –

+0

同样在cmdline.js文件中,默认情况下是否知道'〜/ certs'? '默认:{ 区域: '我们西-2', 协议: 'mqtts', 的clientId:clientIdDefault, 专用密钥: 'private.pem.key', clientCert: 'certificate.pem.crt', caCert:'root-CA.crt',' –

1

默认情况下,示例程序将查找您的证书和私钥文件的当前目录,但你也可以使用“-f”选项,如果你想指定另一个目录。至于您在尝试从浏览器访问端点时注意到的“Missing Authentication Token”消息,您可以放心地忽略它。

0

如果使用“TLS相互身份验证”,您需要在端口8443连接,所以在你的榜样,这将是https://a34sxntm6at7xh.iot.us-west-2.amazonaws.com:8443/things/<thing_name>/shadow