Is possible to integrate Auth0 to Firebase like this way?

匆匆过客 提交于 2021-01-29 05:27:54

问题


I am building an app in VueJs and I am looking for the best way to do the authentication part, there is an API in progress as well that will need token verification for protected end points. I would like to know if is possible to integrate Auth0 to Firebase in a way that Firebase is the main center of communication between the VueJs app and Auth0 (the same thing with the API -> Firebase -> Auth0).

I am asking this because I would like to know exactly if I can save some lines of code and performance using Firebase tools to get what I need from Auth0 without connecting directly to Auth0 API. Also I would like to use Fire Store to save the tokens I get from Auth0.

is possible to have this kind of architecture?

Here is a diagram for a better understanding of the wished result, hope is not confusing. https://ibb.co/68tpw8L

Thank you!

These links are the closest solutions I found thru Google. But according with the info I found you can do this but using Auth0 as my main gateway but I want all the contrary, using Firebase as the main gateway.

https://firebase.google.com/docs/auth/web/custom-auth#before-you-begin https://auth0.com/docs/api/authentication#delegation https://firebase.google.com/docs/web/setup https://auth0.com/blog/developing-real-time-apps-with-firebase-and-firestore/


回答1:


Auth0 has deprecated the /delegation endpoint which is used to get the token for third party vender. https://auth0.com/docs/migrations#api-authorization-with-third-party-vendor-apis

As a workaround, use the firebase custom token authentication mechanism. https://firebase.google.com/docs/auth/admin/create-custom-tokens https://firebase.google.com/docs/reference/js/firebase.auth.Auth.html#signinwithcustomtoken

To create a custom token, you can use the firebase function if you do not have a backend server.

The entire flow is described in the following auth0 blogs with a complete project.

https://auth0.com/blog/how-to-authenticate-firebase-and-angular-with-auth0-part-1/

https://auth0.com/blog/how-to-authenticate-firebase-and-angular-with-auth0-part-2/



来源:https://stackoverflow.com/questions/56502036/is-possible-to-integrate-auth0-to-firebase-like-this-way

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