简体   繁体   English

我们如何在Web浏览器中使用AWS Kinesis?

[英]How can we use AWS Kinesis in a web browser?

How can we use AWS Kinesis in a web browser? 我们如何在Web浏览器中使用AWS Kinesis?

I'm interested in AWS Kinesis Stream and wondering if I can use it to send users' activity logs directly from their browsers to AWS. 我对AWS Kinesis Stream感兴趣并想知道我是否可以使用它将用户的活动日志直接从他们的浏览器发送到AWS。

AWS provides a JavaScript SDK which is executable in a web browser but, according to its document, the SDK requires credential information because of which, I think, it's not secure to use it in my use case. AWS提供了一个可在Web浏览器中执行的JavaScript SDK ,但根据其文档,SDK需要凭据信息,因此,我认为在我的用例中使用它是不安全的。

Should I put proxy servers between their browsers and AWS Kinesis? 我应该在他们的浏览器和AWS Kinesis之间放置代理服务器吗? Or is there any secure way to use AWS Kinesis in such a case? 或者在这种情况下是否有使用AWS Kinesis的安全方法?

You have couple of options to use the JS SDK directly from the browsers of your users without embedding credentials in your code or force your users to log in into a service: 您可以直接从用户的浏览器中使用JS SDK,而无需在代码中嵌入凭据或强制用户登录服务:

The first one is to use AWS Cognito . 第一个是使用AWS Cognito You can embed couple of line of code in your JS code that will identify the identity pool you want to use. 您可以在JS代码中嵌入几行代码,以识别您要使用的标识池。 On the service side you define the role for unauthenticated users to be able to write to Kinesis. 在服务端,您可以定义未经身份验证的用户可以写入Kinesis的角色。 You can see more details in this blog post: https://blogs.aws.amazon.com/javascript/post/Tx1F7FO6GDAIXD3/Authentication-with-Amazon-Cognito-in-the-Browser 您可以在此博客文章中查看更多详细信息: https//blogs.aws.amazon.com/javascript/post/Tx1F7FO6GDAIXD3/Authentication-with-Amazon-Cognito-in-the-Browser

The second option is to put API-Gateway between your users and the Kinesis stream. 第二个选项是在用户和Kinesis流之间放置API-Gateway The gateway is a managed service that you can define as "open" with no authentication and the gateway can be the one with the permission to write to your Kinesis stream. 网关是一种托管服务,您可以将其定义为“打开”而不进行身份验证,网关可以是具有写入Kinesis流的权限的网关。 The simplest way is to use a Lambda function that will be able also to transform/clean the events before putting them to the stream. 最简单的方法是使用Lambda函数,该函数在将事件放入流之前也能够转换/清除事件。 See more details in the service documentations: http://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started.html 请参阅服务文档中的更多详细信息: http//docs.aws.amazon.com/apigateway/latest/developerguide/getting-started.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我们可以使用带有 WebRTC 的 AWS Kinesis 视频流记录浏览器屏幕吗? - Can we record browser screen with AWS Kinesis video streams with WebRTC? 我们如何在 2020 年使用带有 Web Speech API 的流? - How can we use an stream with Web Speech API in 2020? 为什么我们可以在浏览器中使用全局变量? - Why can we use global variable in browser? 如何使网络浏览器使用50%的CPU - How can I cause a web browser to use 50% CPU 如何在不提供凭据的情况下在浏览器中使用 Kinesis Video Stream WebRTC SDK? - How to use Kinesis Video Stream WebRTC SDK in the browser without providing credentials? 我们如何使音频在所有浏览器中都能工作,如果浏览器不支持音频,我们可以使用什么原语? - How can we make audio works in all browsers, what primitive can we use if a browser doesn't support it? 我们可以使用couchdb进行Web应用程序开发吗? - can we use couchdb for web application development? 我们可以设置/编辑网络浏览器的加载动画/标签时间吗? - Can we set/edit the loading animation/label time of the web browser? 我们如何使用 AWS lambda“事件”(API 网关)作为可读流? - How can we use the AWS lambda “event” (API Gateway) as a Readable stream? 我们可以在AWS Lambda中使用ES6类语法吗? - Can we use the ES6 class syntax in AWS Lambda?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM