Azure AD B2C 中具有自定义策略的多租户 Azure AD 身份验证
Multi-Tenant Azure AD Auth in Azure AD B2C with Custom Policies
我正在尝试使用 /common Azure AD enpoint 在 Azure AD B2C 中使用 Azure AD Auth。根据 How to sign in any Azure Active Directory (AD) user using the multi-tenant application pattern,需要有一种机制可以:
- 允许多个颁发者,或者
- 指定 b2c 可以验证的发行者列表。
我在自定义策略 XML 中看不到任何可能允许这样做的设置。我能够在我的 TrustFrameworkExtensions.xml 文件中成功创建 Azure AD 身份验证,只是现在不是多租户。
为了支持多租户 Azure AD,您需要在自定义策略中使用不同的值配置您的 ClaimsProvider。
使用以下值,确保替换为 client_id 和 IdTokenAudience。
<Item Key="DiscoverMetadataByTokenIssuer">true</Item>
<Item Key="ValidTokenIssuerPrefixes">https://sts.windows.net/</Item>
<Item Key="authorization_endpoint">https://login.microsoftonline.com/common/oauth2/authorize</Item>
<Item Key="client_id">df5b2515-a8d2-4d91-ab4f-eac6e1e416c2</Item>
<Item Key="BearerTokenTransmissionMethod">AuthorizationHeader</Item>
<Item Key="scope">openid</Item>
<Item Key="UsePolicyInRedirectUri">false</Item>
<Item Key="HttpBinding">POST</Item>
<Item Key="response_types">id_token</Item>
<Item Key="IdTokenAudience">df5b2515-a8d2-4d91-ab4f-eac6e1e416c2</Item>
注意:此功能尚未正式推出预览版,因此请谨慎使用。继续关注 official "Sign in by using Azure AD accounts" documentation 以了解何时对此进行全面记录和支持。
编辑:
此功能现在处于预览状态,请参阅官方文档:Allow users to sign in to a multi-tenant Azure AD identity provider using custom policies
我正在尝试使用 /common Azure AD enpoint 在 Azure AD B2C 中使用 Azure AD Auth。根据 How to sign in any Azure Active Directory (AD) user using the multi-tenant application pattern,需要有一种机制可以:
- 允许多个颁发者,或者
- 指定 b2c 可以验证的发行者列表。
我在自定义策略 XML 中看不到任何可能允许这样做的设置。我能够在我的 TrustFrameworkExtensions.xml 文件中成功创建 Azure AD 身份验证,只是现在不是多租户。
为了支持多租户 Azure AD,您需要在自定义策略中使用不同的值配置您的 ClaimsProvider。
使用以下值,确保替换为 client_id 和 IdTokenAudience。
<Item Key="DiscoverMetadataByTokenIssuer">true</Item>
<Item Key="ValidTokenIssuerPrefixes">https://sts.windows.net/</Item>
<Item Key="authorization_endpoint">https://login.microsoftonline.com/common/oauth2/authorize</Item>
<Item Key="client_id">df5b2515-a8d2-4d91-ab4f-eac6e1e416c2</Item>
<Item Key="BearerTokenTransmissionMethod">AuthorizationHeader</Item>
<Item Key="scope">openid</Item>
<Item Key="UsePolicyInRedirectUri">false</Item>
<Item Key="HttpBinding">POST</Item>
<Item Key="response_types">id_token</Item>
<Item Key="IdTokenAudience">df5b2515-a8d2-4d91-ab4f-eac6e1e416c2</Item>
注意:此功能尚未正式推出预览版,因此请谨慎使用。继续关注 official "Sign in by using Azure AD accounts" documentation 以了解何时对此进行全面记录和支持。
编辑:
此功能现在处于预览状态,请参阅官方文档:Allow users to sign in to a multi-tenant Azure AD identity provider using custom policies