带有 Sitecore 和 Dynamics 365 门户的 Azure AD B2C SSO

Azure AD B2C SSO with Sitecore and Dynamics 365 Portals

我们有一个简单的场景,但技术(或实现)使事情变得有点复杂 -

我们使用 Sitecore 作为客户主网站的 CMS,对于业务功能,我们使用 Dynamics 365 门户,我们使用 Azure AD B2C 作为两者的身份提供者。

我们大量定制了 B2C 自定义策略以满足特定要求。

我们在 Sitecore 和 Dynamics 365 门户中使用相同的自定义策略,因此单独登录并完美运行,没有任何问题。

关于 SSO,我们将配置保留为 OOTB,您可以找到它 here

只有1或2个用户旅程是绝对完美的无缝旅程。在特定的旅程中,我们需要用户在两端登录才能正常工作(我们可以强制用户去登录页面,但不是所有页面都需要)。

为了了解真正和适当的 SSO 应该如何在 Azure AD B2C 中工作,我不知道或没有经验将此过程关联到。所以我在这里寻求指导和帮助。

我在 中找到了关于 B2C 如何在登录和提供令牌过程方面工作的非常好的信息,但这是一个老问题,从那以后事情发生了很大变化,特别是 UI 和一些操作。

使用下面的 docs when configuring sessions management for a custom policy. Session Behavior 部分是您定义哪种 SSO 行为的地方。具体来说:

<SingleSignOn Scope="Application" />

如果您希望您的用户在所有应用程序之间获得 SSO,请将此值定义为 "Tenant"。在会话之间创建分离有几个有用的场景 - 例如一家公司有多个不希望彼此冲突的 b运行ds。或者经历的分离。

遵循要放置在您的策略中的确切格式和位置,否则您将无法获得预期的结果。

另一个重要的概念是理解 session provider:

SSO session management has two parts. The first deals with the user's interactions directly with Azure AD B2C and the other deals with the user's interactions with external parties such as Facebook. Azure AD B2C does not override or bypass SSO sessions that might be held by external parties. Rather the route through Azure AD B2C to get to the external party is “remembered”, avoiding the need to reprompt the user to select their social or enterprise identity provider. The ultimate SSO decision remains with the external party.

会话提供程序用于定义维护在执行策略时生成会话的内容(在身份体验框架内)。如果标记不正确,这可能会导致不良结果,例如发送错误的索赔、额外的 MFA 提示、在 运行 时您的部分保单未得到维护或只是一般错误。

这是为那些对我们如何实现这一点感兴趣的人准备的 -

Sitecore 也提供 OOTB Azure AD B2C 配置,但是 Sitecore 交付方的供应商决定不使用 OOTB 配置方法,因此导致了很多问题。从我读到的有关 Azure AD B2C 的 Sitecore 配置的内容来看,它确实可以在仔细配置的情况下与 B2C 顺利配合使用。

解决方法:我们不得不依赖外部触发器(例如 cookie),它会指示并触发用户已在任何一方签名,因此双方的登录过程都会启动。