是否可以通过这种方式将Auth0集成到Firebase? [英] Is possible to integrate Auth0 to Firebase like this way?

查看:98
本文介绍了是否可以通过这种方式将Auth0集成到Firebase?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在VueJs中构建一个应用程序,我正在寻找进行身份验证部分的最佳方法,正在开发一个API,该API也需要对受保护端点进行令牌验证.我想知道是否有可能以一种方式将Auth0集成到Firebase中,即Firebase是VueJs应用程序与Auth0之间的主要通信中心(与API-> Firebase-> Auth0相同).

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).

我之所以这样问,是因为我想确切知道我是否可以使用Firebase工具保存一些代码行和性能,以从Auth0中获得所需的内容,而无需直接连接到Auth0 API.另外,我想使用Fire Store保存从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.

可能有这种架构吗?

这里是一个图表,用于更好地了解期望的结果,希望不会造成混淆. https://ibb.co/68tpw8L

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

谢谢!

这些链接是我通过Google找到的最接近的解决方案.但是根据我发现的信息,您可以执行此操作,但可以使用Auth0作为我的主要网关,但我希望相反,可以使用Firebase作为主要网关.

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/

推荐答案

Auth0已弃用/delegation端点,该端点用于获取第三方供应商的令牌. https://auth0.com/docs/migrations#带有第三方供应商api的api授权

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

作为解决方法,请使用firebase自定义令牌身份验证机制. https://firebase.google.com/docs/auth/admin/创建自定义令牌 https://firebase.google.com/docs/reference/js/firebase.auth.Auth.html#signinwithcustomtoken

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

要创建自定义令牌,如果没有后端服务器,则可以使用firebase函数.

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

在以下带有完整项目的auth0博客中描述了整个流程.

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

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

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

这篇关于是否可以通过这种方式将Auth0集成到Firebase?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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