[英]Azure AD B2C and regular (SQL) Identity .Net6
Just have general question if it possible to use Azure AD B2C to LogIn to the project and inside project manage Identity Users?如果可以使用 Azure AD B2C 登录项目并在项目内部管理身份用户,请问是否有一般性问题? The problem is we have internal (company workers) in Azure AD and external users (customers) in SQL Identity tables like AspNetUsers,AspNetRoles...I created new project and point to it Azure AD B2C it works to LogIn/LogOut but as soon as I scaffold Identity it replace login Page (Windows Login Page) with own Identity Page and want user to logIn as regular Identity user.
问题是我们在 Azure AD 中有内部(公司员工),在 SQL 中有外部用户(客户)身份表,如 AspNetUsers、AspNetRoles...我创建了新项目并指向它 Azure AD B2C 它适用于登录/注销,但很快当我搭建身份时,它将登录页面(Windows 登录页面)替换为自己的身份页面,并希望用户以普通身份用户身份登录。 The goal is to create users management inside this app login to which is with Azure AD B2C.
目标是在此应用程序登录中创建用户管理,使用 Azure AD B2C。 Sorry no any code here, is general question is it possible at all?
抱歉,这里没有任何代码,一般问题是否可能? Thnks in advance
提前致谢
So you want to log in with Azure B2C and manage users in an external DB?所以你想用 Azure B2C 登录并在外部数据库中管理用户?
You would have to create "shadow" users in B2C, store the minimum attributes and then use a REST API to get the rest from SQL.您必须在 B2C 中创建“影子”用户,存储最少的属性,然后使用 REST API 从 SQL 获取 rest。
You would need some attribute to map a B2C user to a SQL user.你需要一些属性来 map 一个 B2C 用户到一个 SQL 用户。
And keep the users in synch.并使用户保持同步。
Also, the password would have to live in B2C.此外,密码必须存在于 B2C 中。
Why don't you just migrate the users?为什么不直接迁移用户?
You could migrate the user details (first name, surname etc.) and leave the complex role structure in SQL and access it via REST API. You could then add those roles to the JWT returned to the user.您可以迁移用户详细信息(名字、姓氏等)并将复杂的角色结构保留在 SQL 中,并通过 REST API 访问它。然后您可以将这些角色添加到返回给用户的 JWT 中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.