How to implement Firebase custom authentication backend?

[亡魂溺海] 提交于 2019-12-10 23:37:52

问题


I want custom firebase authentication where a user manages the roles of subordinate users. I need guidance on understanding on how to implement my own backend authentication system. Everywhere the documentation keeps mentioning that 'send the username and password to your backend that will generate a custom token'. What is this backend? where do I pursue this? My knowledge domain is firebase, firebase functions, angular 2/4, ionic2 for this discussion... thanks


回答1:


You will have to send the email password to the firebase sdk in using javascript in web then when the sdk success functions tell that the user has been authenticated the web page will send result to your backend server (can be nodejs or php etc) from there you have to manage your own database to handle all the role base access.

Firebase is basically authenticating the user for you and telling you that you can identify this user using the following userid and then build your own system.

Firebase has access rules but those you have to define first you cannot fully customize them for each user.

For password auth see this: https://firebase.google.com/docs/auth/web/password-auth




回答2:


An easy way to do custom auth with Firebase is using an external identity provider. Auth0 is an example of such a provider.

Guide:

https://shusson.info/post/usingfirebaseandauth0together

code:

https://github.com/shusson/firebase-custom-auth



来源:https://stackoverflow.com/questions/46023532/how-to-implement-firebase-custom-authentication-backend

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!