首页 > 解决方案 > 在 Azure AD B2C 自定义策略中,IdentityExperienceFrameworkApps 如何在没有秘密的情况下连接到 AD

问题描述

还发布到https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/issues/29

B2C 自定义策略 Starterpack中,我们的文件LocalAccounts/TrustFrameworkExtensions.xml包含:

<TechnicalProfiles>
   <TechnicalProfile Id="login-NonInteractive">
    <Metadata>
      <Item Key="client_id">ProxyIdentityExperienceFrameworkAppId</Item>
      <Item Key="IdTokenAudience">IdentityExperienceFrameworkAppId</Item>
    </Metadata>
    <InputClaims>
      <InputClaim ClaimTypeReferenceId="client_id" DefaultValue="ProxyIdentityExperienceFrameworkAppID" />
      <InputClaim ClaimTypeReferenceId="resource_id" PartnerClaimType="resource" DefaultValue="IdentityExperienceFrameworkAppID" />
    </InputClaims>
  </TechnicalProfile>
</TechnicalProfiles>

有人可以解释为什么需要两个应用程序才能使这些自定义策略起作用吗?IEF 如何使用它们?

此外,在这些文件中,我没有看到任何秘密或应用程序密钥被传递给 IEF。IEF 如何仅使用应用程序 ID 连接到 AAD?

标签: azure-ad-b2c

解决方案


login-NonInteractive技术配置文件通过使用资源所有者密码凭据授予类型向 Azure AD 目录发送访问令牌请求来对本地帐户进行身份验证:

<Metadata>
  <Item Key="authorization_endpoint">https://login.microsoftonline.com/{tenant}/oauth2/token</Item>
</Metadata>
<InputClaims>
  <InputClaim ClaimTypeReferenceId="grant_type" DefaultValue="password" />
  <InputClaim ClaimTypeReferenceId="client_id" DefaultValue="ProxyIdentityExperienceFrameworkAppID" />
  <InputClaim ClaimTypeReferenceId="resource_id" PartnerClaimType="resource" DefaultValue="IdentityExperienceFrameworkAppID" />
  <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="username" Required="true" />
  <InputClaim ClaimTypeReferenceId="password" Required="true" />
  <InputClaim ClaimTypeReferenceId="scope" DefaultValue="openid" />
  <InputClaim ClaimTypeReferenceId="nca" PartnerClaimType="nca" DefaultValue="1" />
</InputClaims>

与 Azure AD 目录的所有访问令牌请求一样,此访问请求必须包含客户端应用程序(即ProxyIdentityExperienceFramework应用程序)和资源应用程序(即IdentityExperienceFramework应用程序)的标识符。

您不必为客户端应用程序指定密钥,因为它已注册为本机应用程序


推荐阅读