简体   繁体   English

从 Azure AD 模拟到 Azure B2C

[英]Impersonation from Azure AD to Azure B2C

We are working on a web application that requires two different types of users:我们正在开发一个需要两种不同类型用户的 Web 应用程序:

  • Administrators (mapped to Azure AD, SSO);管理员(映射到 Azure AD、SSO);
  • Customers (mapped to Azure AD B2C);客户(映射到 Azure AD B2C);

Customers log into the web application using their Azure AD B2C account.客户使用其 Azure AD B2C 帐户登录 Web 应用程序。 Administrators log into an administration UI area of the website using their Azure AD account.管理员使用他们的 Azure AD 帐户登录到网站的管理 UI 区域。 This part is fine.这部分很好。

However, one of the requirements is that the Administrators are able to impersonate the Customer, so that they can carry out certain tasks on-behalf of the customer eg place an order.但是,其中一项要求是管理员能够模拟客户,以便他们可以代表客户执行某些任务,例如下订单。

We'll be using OAuth (.NET package) for the authorisation.我们将使用 OAuth(.NET 包)进行授权。 My question is two fold really:我的问题实际上有两个方面:

1) Does OAuth support impersonation of other accounts? 1) OAuth 是否支持模拟其他账户?

2) If yes, is it even possible for an account in Azure AD to impersonate a user in Azure AD B2C - currently they are different directories with no visibility of one another. 2) 如果是,Azure AD 中的帐户是否甚至可以模拟 Azure AD B2C 中的用户 - 目前它们是不同的目录,彼此不可见。

Perhaps my questions are a little vague, we're looking for some pointers in the right direction.也许我的问题有点含糊,我们正在寻找正确方向的一些指示。

Many thanks in advance提前谢谢了

dotdev开发者

You can build a flow which authenticates the Admin via the federated IdP (AAD), then presents them a B2C page which allows them to impersonate a B2C user: https://github.com/azure-ad-b2c/samples/tree/master/policies/impersonation .您可以构建一个流,通过联合 IdP (AAD) 对管理员进行身份验证,然后向他们展示一个 B2C 页面,允许他们模拟 B2C 用户: https : //github.com/azure-ad-b2c/samples/tree/主/策略/模拟 The policy should do some checks to make sure the AAD user is in some group who can impersonate, then present them a screen in B2C to provide the end users email.该策略应该进行一些检查以确保 AAD 用户属于可以模拟的某个组,然后在 B2C 中向他们展示一个屏幕以向最终用户提供电子邮件。 B2C will then finish the authentication by minting a token that is in the B2C users context.然后,B2C 将通过铸造 B2C 用户上下文中的令牌来完成身份验证。

Azure AD (regular/B2C) does not allow you to impersonate other users. Azure AD(常规/B2C)不允许你模拟其他用户。 You can't really login as the user.您无法真正以用户身份登录。

You will most likely have to build this functionality into your application, where the admin is allowed to choose a customer on whose behalf they are making the order.您很可能必须将此功能构建到您的应用程序中,管理员可以在其中选择代表他们下订单的客户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM