gpt4 book ai didi

javascript - 如何使用应用程序和 secret 进行安全解析初始化?

转载 作者:行者123 更新时间:2023-11-30 16:57:30 26 4
gpt4 key购买 nike

我正在用 javascript 设置解析框架。我注意到我需要打电话

Parse.initialize("app", "secret")

因为这是在页面源代码中,难道没有人可以拿走它并针对我的帐户进行调用吗?

是否有更安全的方式来存储此信息?

最佳答案

根据 Parse Security Guide您的JavaScript key 不是 secret :

When an app first connects to Parse, it identifies itself with an Application ID and a Client key (or REST Key, or .NET Key, or JavaScript Key, depending on which platform you're using). These are not secret and by themselves they do not secure an app. These keys are shipped as a part of your app, and anyone can decompile your app or proxy network traffic from their device to find your client key. This exploit is even easier with JavaScript — one can simply "view source" in the browser and immediately find your client key.

是的,任何找到您 key 的人都可以调用电话。但是您可以(并且应该)限制任何人可以做的事情。

使用 Class-Level Permissions你限制了个别类(class)可以做什么。

使用 Object-Level Permissions您限制可以对选定对象执行的操作。

另见 RolesRoles Hierarchy用于同时为一组多个用户设置权限。

例如,您可以限制特定用户的访问权限。仅当这些用户之一登录时,才会授予访问权限。任何其他“黑客”都可以尝试使用您的 key ,但该请求将被 Parse 拒绝。

关于javascript - 如何使用应用程序和 secret 进行安全解析初始化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29449248/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com