管理 AD B2C 中的随机查询字符串值

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

在这种情况下,一旦用户请求 b2c 登录/注册,每次 Web 应用程序都会将该请求重定向到 b2c,并且该请求每次都会附加随机查询字符串值。

现在,从 B2C 端,我们必须读取这些随机/动态查询字符串参数,并将查询字符串参数作为 JWT 令牌响应中的声明返回给调用应用程序。

查询参数示例:

&xyz=12345 / &token=AGCOMM_678_IRA

有处理这些情况的参考吗?我们必须在此技术配置文件中修改哪些内容才能读取随机/动态查询字符串值?

<ClaimsProvider>
<DisplayName>check Parameter</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="Get-Parameters">
<DisplayName>Profile to fill claims with parameter values</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="myParameter" DefaultValue="{oauth-kv:my_parameter}" AlwaysUseDefaultValue="true"/> 
</OutputClaims>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
azure-ad-b2c azure-ad-graph-api azure-ad-b2c-custom-policy
1个回答
1
投票

使用索赔解析器

例如

<InputClaims>
    <InputClaim ClaimTypeReferenceId="Query" DefaultValue="{OAUTH-KV:xyz}" />
</InputClaims>

“查询”的值为 12345。

注:

设置:

  • IncludeClaimResolvingInClaimsHandling 元数据必须设置为 true
  • 输入或输出声明属性 AlwaysUseDefaultValue 必须设置为 true
© www.soinside.com 2019 - 2024. All rights reserved.