【问题标题】:Custom Policies and application insights自定义策略和应用洞察
【发布时间】:2018-03-02 20:09:59
【问题描述】:

我正在尝试使 App Insights 正常工作,以便我可以使用以下方法调试我的策略:

https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-troubleshoot-custom

并基于这个项目: https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/LocalAccounts

进行了适当的修改:

<TrustFrameworkPolicy
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
    PolicySchemaVersion="0.3.0.0"
    TenantId="B2CPruebaProteccion.onmicrosoft.com"
    PolicyId="B2C_1A_PasswordReset"
    PublicPolicyUri="http://B2CPruebaProteccion.onmicrosoft.com/B2C_1A_PasswordReset
    UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">

    <BasePolicy>
        <TenantId>B2CPruebaProteccion.onmicrosoft.com</TenantId>
        <PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
    </BasePolicy>

    <RelyingParty>
        <DefaultUserJourney ReferenceId="PasswordReset" />
        <UserJourneyBehaviors>
            <JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="00000000-0000-0000-0000-000000000000" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />
        </UserJourneyBehaviors>
        <TechnicalProfile Id="PolicyProfile">
        ...
</TrustFrameworkPolicy>

我的数据未显示在 App Insights 中。如何验证/修复此错误?

【问题讨论】:

  • 你的意思是什么错误?
  • 没有在应用程序中写入任何内容

标签: azure-ad-b2c


【解决方案1】:

您还必须将DeploymentMode="Development" 属性添加到TrustFrameworkPolicy 元素。

例如:

<TrustFrameworkPolicy
  PolicySchemaVersion="0.3.0.0"
  TenantId="contoso.onmicrosoft.com"
  PolicyId="B2C_1A_sign_up_sign_in"
  PublicPolicyUri="http://contoso.onmicrosoft.com"
  DeploymentMode="Development"
  UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    ...
</TrustFrameworkPolicy>

【讨论】:

    【解决方案2】:

    除非您对将用户数据推送到应用洞察力感到高兴,否则不要将应用洞察力与自定义策略一起使用

    旅程记录器端点 - urn:journeyrecorder:applicationinsights 抓取所有内容并将其放入应用洞察,所有用户名、密码以明文形式存在于应用洞察中。

    最好的办法是创建一个函数应用程序,该应用程序接受任何表单主体并将您想要从 B2C 发送的任何声明传递给它,然后在技术提供程序中使用 RESTFul 提供程序调用它

    这样您就可以阻止敏感数据进入应用洞察

    他们也很清楚不要在生产环境中使用旅程记录器,因为它会减慢生产速度

    【讨论】:

      猜你喜欢
      • 2018-10-24
      • 1970-01-01
      • 1970-01-01
      • 2017-04-28
      • 2016-06-13
      • 2021-04-05
      • 1970-01-01
      • 2023-03-25
      相关资源
      最近更新 更多