简体   繁体   English

parse.com-限制谁可以注册

[英]parse.com - Limiting who can sign up

I might be missing something in the security documentation for parse.com but I don't see how to limit who can sign up to the app? 我可能在parse.com的安全文档中缺少某些内容,但是我看不到如何限制谁可以注册该应用程序?

I am making an app (html/javascript) with parse as the backend. 我正在使用解析为后端的应用程序(html / javascript)。 The data will be shared amongst a team of people. 数据将在一组人员之间共享。

What stops someone from using the sign up javascript code to create their own account with the correct role that then gives them access to the parse database? 是什么阻止某人使用注册javascript 代码创建具有正确角色的自己的帐户,然后授予他们访问解析数据库的权限?

A requirement to allow only members of a particular team to create an identity (sign up) implies that you have an external means of establishing someone's identity as a team member in the first place. 仅允许特定团队的成员创建身份(注册)的要求意味着,您首先需要具有外部手段来建立某人作为团队成员的身份。

How you get this done with parse's generic (I would argue reasonably generic) User model depends on those external means. 如何使用parse的泛型(我会说合理的泛型)来完成此任务用户模型取决于那些外部手段。 But the effect in parse ought to be, if someone proves they are "on the team", assign their users to an onTheTeam role. 但是,如果有人证明自己“在团队中”,那么解析的效果应该是将其用户分配给onTheTeam角色。 Then, via class-level permissions or ACLs, provide more privilege to users who are members of that role and fewer/none to users who aren't. 然后,通过类级别权限或ACL,为作为该角色成员的用户提供更多特权,而为不是该角色的用户提供更少/没有特权。

Here are some ideas about establishing team membership to an externally defined team: 以下是有关建立外部定义的团队的成员身份的一些想法:

  1. If team membership can be established via an api to another system: On a beforeSave hook for the Parse.User , call that api and assign them to the "onTheTeam" role if successful, otherwise fail with an error. 如果可以通过API到另一个系统建立团队成员:在一个beforeSave挂钩的Parse.User ,调用API,并将它们分配给“onTheTeam”的角色,如果成功,否则失败的错误。

  2. If you know team members' email addresses: Have parse send an email verification challenge to new registrants. 如果您知道团队成员的电子邮件地址:解析将电子邮件验证挑战发送给新注册人。 Upon user save, assign them to the "onTheTeam" role if and only if their email is on the list and their emailVerified property is true. 保存用户后,当且仅当他们的电子邮件在列表中并且他们的emailVerified属性为true时,才将他们分配给“ onTheTeam”角色。 (I've used this approach successfully for an app in production). (我已经成功将这种方法用于生产中的应用程序)。

  3. If the team is just a handful of friends: pass everyone a secret via an outside channel. 如果团队中只有少数几个朋友:请通过外部渠道向所有人传递一个秘密。 Have your registration collect name, password and the secret, and assign these to the new user. 让您的注册收集名称,密码和机密,然后将其分配给新用户。 Validate the secret in a beforeSave hook on Parse.User . 验证的秘密beforeSave挂机Parse.User If valid, add the user to the "onTheTeam" role, otherwise prevent the save with an error. 如果有效,请将用户添加到“ onTheTeam”角色,否则以错误阻止保存。 (The outside channel you employ to pass the secret depends on the security of your app... eg For a highly secure app, ask each team member to meet you at a particular park bench, wear a fedora and pass the secret in a rolled-up newspaper). (您用来传递秘密的外部渠道取决于应用程序的安全性。例如,对于高度安全的应用程序,请每个团队成员在特定的公园长椅上与您见面,戴软呢帽并以滚动方式传递秘密报纸)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM