是否可以限制用户可用于登录 Firebase 应用的设备数量?
Is it possible to limit the number of devices a user can log in to a Firebase app with?
上下文:
我正在使用 Vue 帮助更新一个 Cordova 应用程序,以从基于订阅的收入(用户必须付费才能访问该应用程序)转变为基于广告的收入(用户可以免费注册但将拥有在他们使用应用程序时显示在应用程序中的广告。我们想要做的部分事情是限制用户可以拥有帐户的设备数量,以避免有人决定与他们的一千个朋友共享他们的付费帐户。我想效仿 Netflix 使用他们的帐户所做的事情。
Netflix too many accounts screen
这是我想到的使用 email/password 身份验证 (https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signinwithemailandpassword)
的工作流程
// I would like to have device information at this point in the application
firebase.auth().signInWithEmailAndPassword(email, password)
.then(function(result) {
// Use Realtime Database to associate the device with the user
})
.catch(function(error) {
// I'd like to catch the "too-many-devices" error here, but if needed, I can use the success handler to check device limits
})
遗憾的是,文档中列出的错误代码没有提及“设备太多”类错误,这意味着 Firebase 身份验证很可能没有我正在寻找的内置功能它。
根据此支持文档 (https://support.google.com/firebase/answer/6318039?hl=en), it sounds like Firebase Analytics has some way to identify the device already. I would like to access that if possible. Other searches I've done always seem to point me to auth limits (https://firebase.google.com/docs/auth/limits),其中没有提及任何关于独特设备的信息。
是否可以限制用户可用于登录 Firebase 应用的设备数量?
Firebase Auth 不提供任何机制来跟踪或限制用户使用的设备数量。事实上,它真正做的就是公开 public API,这些 API 可以在 Internet 上的任何地方使用。一点“装置”感都没有
如果您想限制用户可以使用的设备数量,您必须自己以某种方式实施。由于 Firebase 基本上允许来自任何来源的无限制登录,因此您将无法严格执行此操作。有人将能够找到一种方法来解决您实施的任何问题。但是您当然可以在您的应用程序中执行大量检查以确保跟踪和限制不同的设备,并假设最终用户不会尝试绕过您的限制。
上下文: 我正在使用 Vue 帮助更新一个 Cordova 应用程序,以从基于订阅的收入(用户必须付费才能访问该应用程序)转变为基于广告的收入(用户可以免费注册但将拥有在他们使用应用程序时显示在应用程序中的广告。我们想要做的部分事情是限制用户可以拥有帐户的设备数量,以避免有人决定与他们的一千个朋友共享他们的付费帐户。我想效仿 Netflix 使用他们的帐户所做的事情。
Netflix too many accounts screen
这是我想到的使用 email/password 身份验证 (https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signinwithemailandpassword)
的工作流程// I would like to have device information at this point in the application
firebase.auth().signInWithEmailAndPassword(email, password)
.then(function(result) {
// Use Realtime Database to associate the device with the user
})
.catch(function(error) {
// I'd like to catch the "too-many-devices" error here, but if needed, I can use the success handler to check device limits
})
遗憾的是,文档中列出的错误代码没有提及“设备太多”类错误,这意味着 Firebase 身份验证很可能没有我正在寻找的内置功能它。
根据此支持文档 (https://support.google.com/firebase/answer/6318039?hl=en), it sounds like Firebase Analytics has some way to identify the device already. I would like to access that if possible. Other searches I've done always seem to point me to auth limits (https://firebase.google.com/docs/auth/limits),其中没有提及任何关于独特设备的信息。
是否可以限制用户可用于登录 Firebase 应用的设备数量?
Firebase Auth 不提供任何机制来跟踪或限制用户使用的设备数量。事实上,它真正做的就是公开 public API,这些 API 可以在 Internet 上的任何地方使用。一点“装置”感都没有
如果您想限制用户可以使用的设备数量,您必须自己以某种方式实施。由于 Firebase 基本上允许来自任何来源的无限制登录,因此您将无法严格执行此操作。有人将能够找到一种方法来解决您实施的任何问题。但是您当然可以在您的应用程序中执行大量检查以确保跟踪和限制不同的设备,并假设最终用户不会尝试绕过您的限制。