使用Azure AD B2C进行Firebase身份验证

编程入门 行业动态 更新时间:2024-10-25 04:16:27
本文介绍了使用Azure AD B2C进行Firebase身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个使用xCode/Swift开发的本地iOS应用程序,该应用程序集成了 Firebase身份验证用于注册和登录新用户的SDK. Firebase Auth系统应链接到 Azure Active Directory B2C 这样:

I have a native iOS application developed in xCode/Swift that integrates the Firebase Auth SDK for registering and login of new users. The Firebase Auth system should be linked to an Azure Active Directory B2C so that:

  • 已创建的新用户同时存在于Firebase身份验证和Azure AD B2C中(我猜是否具有相同的凭据?)
  • 用户登录时,他/她都在Firebase Auth和Azure AD B2C上下文中登录,因此可以在两个平台上进行安全调用
  • 在Azure AD B2C或firebase Auth上删除用户时,也应该在其他平台上删除用户. 为此,我可以使用在Auth事件上触发的Firebase函数与Azure AD B2C进行同步.对于将Azure AD B2C返回Firebase Auth,我还可以预见一个可以被Azure AD B2C调用的Firebase函数确实会删除用户.

经过研究,我发现Firebase支持自定义令牌"(请参阅​​ firebase.google/docs/auth/admin/create-custom-tokens ). 这可以提供解决方案吗?我看不到关于创建新用户的任何信息,仅是身份验证...

After doing research I found that Firebase supports "custom tokens" (refer to firebase.google/docs/auth/admin/create-custom-tokens). Could this offer a solution? I do not see anything about creating new users, only authentication...

推荐答案

我和我的团队针对自定义令牌开发了针对此确切方案的解决方案.我们的实施自几个月以来一直在Azure上运行,现在我们还没有出现任何问题.

Me and me team developed a solution for this exact scenario around custom tokens. Our implementation run since a couple of months on Azure and we had no problem at all yet.

以下是流程:

注意:

  • Azure B2C可以用任何STS代替.
  • Azure功能可以由任何后端进程替换.
  • 此外,好处是您不必在Firebase中维护用户,因为您无需创建Firebase用户,而只需使用自定义令牌即可,因此无需删除用户.

    Also, the good thing is that you don't have to maintain users in Firebase since you don't create Firebase users and only use a custom token so no need to delete users.

    更多推荐

    使用Azure AD B2C进行Firebase身份验证

    本文发布于:2023-11-28 09:08:52,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1641793.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:身份验证   AD   Azure   Firebase   B2C

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!