How to use AWS IoT to send/receive messages to/from Web Browser

前端 未结 4 896
无人共我
无人共我 2021-01-30 13:39

We are trying to use Amazon Web Services Internet of Things (AWS IoT) to send messages from/to a Web Browser (e.g: . Given that the AWS IoT supports JavaScript we expect

4条回答
  •  星月不相逢
    2021-01-30 14:25

    It is hard to find good tutorials for integrating AWS IoT in browser.

    Basically you need to have some authentication method (Facebook, Google, AWS Cognito, your own SSO service with SAML support) and then you need to do following steps:

    1. Configure Cognito User Pool or Federated Identity Pool with your authentication method.
    2. In browser you have to implement Extended Flow (https://aws.amazon.com/blogs/mobile/understanding-amazon-cognito-authentication-part-4-enhanced-flow/)
    3. You need to AttachPolicy in IoT for your user's Cognito identityId - it will be used as principal (it the same way as devices are using certificates).
    4. You need to create MQTT client using https://github.com/aws/aws-iot-device-sdk-js and providing your temporary accessKeyId, secretKey and sessionToken received from Extended Flow authentication.

提交回复
热议问题