如何在Firebase 3中创建一个用户并且不进行身份验证? [英] How to just create an user in Firebase 3 and do not authenticate it?

查看:82
本文介绍了如何在Firebase 3中创建一个用户并且不进行身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个angularfire项目,我想知道如何在Firebase 3中创建一个用户,一旦完成,就不要验证指定的用户。在之前的Firebase版本中,我们使用了名为createUser(email,password)的方法。现在我们只有createUserWithEmailAndPassword(email,password)方法,它会创建并验证指定的用户。 解决方案

问题是:你不能。

我们有类似的情况,我们有'管理员'用户可以创建其他用户。随着2.x这是一个快照。使用3.x时,这是一个失败,因为该功能已被彻底删除。



如果您在3.x中创建一个用户,您将以该用户身份进行身份验证,并且未经身份验证记录的帐户in。



这会更深,因为您需要重新进行身份验证才能创建另一个用户。所以管理员要么手动或(cringe)在本地存储身份验证数据,所以它可能是一个自动化的过程(畏惧,请不要这样做)

Firebase已经公开强调,2.x将继续得到支持,所以你可能只是想避免3.x.

更新:



其中一名Firebaser实际上提出了一个解决方法。从概念上讲,您有一个管理员用户登录。然后,您创建第二个连接到Firebase并与另一个用户进行身份验证,该连接然后创建新的用户。冲洗 - 重复。

再次更新

看到这个问题和答案

Firebase踢出当前用户


I am working on a angularfire project and I would like to know how can I create an user in Firebase 3 and once done, do not authenticate the specified user. In the previous Firebase version we had the method called createUser(email, password). Now we have the method createUserWithEmailAndPassword(email, password) only, it creates and authenticates the specified user.

解决方案

The answer to the question is: you can't.

We have similar situation where we have 'admin' users that can create other users. With 2.x this was a snap. With 3.x it's a fail as that capability was completely removed.

If you create a user in 3.x you authenticate as that user, and unauthenticate the account that's logged in.

This goes deeper as you would then need to re-authenticate to create another user; so the admin either does that manually or (cringe) stores the authentication data locally so it could be an automated process (cringe cringe, please don't do this)

Firebase has publicly stressed that 2.x will continue to be supported so you may just want to avoid 3.x.

Update:

one of the Firebaser's actually came up with a workaround on this. Conceptually you had an admin user logged in. You then create a second connection to firebase and authenticate with another user, that connection then creates the new user. Rinse - repeat.

Update again

See this question and answer

Firebase kicks out current user

这篇关于如何在Firebase 3中创建一个用户并且不进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆