【问题标题】:Is possible to integrate Auth0 to Firebase like this way?可以像这样将 Auth0 集成到 Firebase 吗?
【发布时间】:2019-10-23 09:59:51
【问题描述】:

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

我之所以问这个问题是因为我想确切地知道是否可以使用 Firebase 工具节省一些代码行和性能,以便在不直接连接到 Auth0 API 的情况下从 Auth0 获得我需要的东西。我也想使用 Fire Store 来保存我从 Auth0 获得的令牌。

有可能有这种架构吗?

这是一个图表,可以更好地理解希望的结果,希望不要混淆。 https://ibb.co/68tpw8L

谢谢!

这些链接是我通过 Google 找到的最接近的解决方案。 但是根据我发现的信息,您可以这样做,但使用 Auth0 作为我的主要网关,但我想要的恰恰相反,使用 Firebase 作为主要网关。

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 进行身份验证,并使用自定义令牌来完成其余的工作。你打算照原样使用云功能吗?本文讨论了如何做到这一点,但使用 aws lambda,也许这可以让你开始 thecloudfunction.com/blog/authenticate-firebase-with-auth0

标签: firebase vue.js integration auth0


【解决方案1】:

Auth0 已弃用 /delegation 端点,该端点用于获取第三方供应商的令牌。 https://auth0.com/docs/migrations#api-authorization-with-third-party-vendor-apis

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

要创建自定义令牌,如果您没有后端服务器,可以使用 firebase 功能。

整个流程在下面的 auth0 博客中都有完整的项目描述。

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/

【讨论】:

    猜你喜欢
    • 2012-03-22
    • 2018-03-16
    • 2012-01-09
    • 1970-01-01
    • 2012-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多