AAD B2C 中的 OAUTH-KV 声明解析器不起作用

问题描述 投票:0回答:3

我正在尝试使用

OAUTH-KV
Claims Resolver 提取名为
foo
的参数值,该参数作为声明传递到 AAD B2C 自定义策略
authorize
端点,也名为
foo

foo
ClaimType
定义为

<ClaimType Id="foo">
  <DisplayName>Foo debug claim</DisplayName>
  <DataType>string</DataType>
  <UserInputType>TextBox</UserInputType>
</ClaimType>

TechnicalProfile
作为

<TechnicalProfile Id="LocalAccount-Register">
  <DisplayName>Register</DisplayName>
  <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <Metadata>
    <Item Key="ContentDefinitionReferenceId">api.localaccount.registration.prescribedfirm</Item>
    <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
    <Item Key="language.button_continue">Create</Item>
  </Metadata>
  <CryptographicKeys>
    <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
  </CryptographicKeys>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="foo" DefaultValue="{OAUTH-KV:foo}" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="foo" Required="true" />
  </OutputClaims>
  <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>

但是,

foo
的值显示为
{OAUTH-KV:foo}
,而不是传递的实际值。

我相信我已遵循文档中的说明。

我还需要做其他事情才能完成这项工作吗?


编辑

与声明解析器相关的文档已于 2019 年 1 月 25 日在此处更新 https://learn.microsoft.com/en-us/azure/active-directory-b2c/claim-resolver-overview,根据该文档,这应该工作。

我无法让 any 声明解析器显示除标记之外的任何内容,即

{Context:CorrelationId}
{OIDC:LoginHint}
等。

有谁知道是否需要任何神奇的

Metadata
值才能完成这项工作?

我确信我做错了什么,遗漏了一些东西,但我无法弄清楚是什么。

非常欢迎任何有用的指点。

azure-ad-b2c identity-experience-framework
3个回答
2
投票

声明解析器仅适用于特定的技术配置文件,即 REST API 和 SelfAsserted(在编排步骤中组合注册和登录内容定义)。它明确仅适用于文档中提供的示例。


2
投票

我知道已经晚了。请参阅我的回答这里

您必须配置技术配置文件的 metadata 并设置输入声明的 AlwaysUseDefaultValue 属性。


0
投票

我目前正在研究在生产中部署的现有 AD B2C 自定义策略扩展 XML,这就是其中配置 ClaimProvider 的方式:

<ClaimsProvider>
  <DisplayName>Self-Asserted ReadQueryParameters</DisplayName>
  <TechnicalProfiles>
    <TechnicalProfile Id="SelfAssserted-ReadQueryParameters">
      <DisplayName>Self-Asserted ReadQueryParameters</DisplayName>
      <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.ClaimsTransformationProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <Metadata>
        <Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
      </Metadata>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="foo" DefaultValue="{OAUTH-KV:foo}" AlwaysUseDefaultValue="true" />
      </OutputClaims>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
    </TechnicalProfile>
  </TechnicalProfiles>
</ClaimsProvider>
© www.soinside.com 2019 - 2024. All rights reserved.