【问题标题】:Azure AD B2C custom policy - send query string parameter to 3rd partyAzure AD B2C 自定义策略 - 向第 3 方发送查询字符串参数
【发布时间】:2020-12-11 18:42:35
【问题描述】:

我正在处理一个 B2C 案例,该案例涉及使用 OpenIdConnect 与第 3 方身份提供商集成。

该第三方期望一个特定的查询字符串参数被发送一次或多次:

example.com/oidc/authorize=?...&login_hint=ABCvalue&login_hint=XYZvalue

我有一份包含所需输入声明的 OpenIdConnect 技术资料:

<TechnicalProfile Id="Example-Swe">
  <DisplayName>Example Sverige</DisplayName>
  <Description>Login with Example</Description>
  <Protocol Name="OpenIdConnect"/>
  <OutputTokenFormat>JWT</OutputTokenFormat>
  <Metadata>
    <Item Key="client_id">preprod.Example</Item>
    <Item Key="METADATA">https://example.com/oidc/.well-known/openid-configuration</Item>
    <Item Key="response_types">code</Item>
    <Item Key="scope">openid phone profile example.national_id offline_access</Item>
    <Item Key="response_mode">query</Item>
    <Item Key="HttpBinding">POST</Item>
    <Item Key="UsePolicyInRedirectUri">false</Item>
  </Metadata>
  <CryptographicKeys>
    <Key Id="client_secret" StorageReferenceId="B2C_1A_ExampleSecretNO1"/>
  </CryptographicKeys>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="acr_values" DefaultValue="urn:example:oidc:method:sbid"/>
    <InputClaim ClaimTypeReferenceId="example_profile" DefaultValue="example-id" />
    <InputClaim ClaimTypeReferenceId="ui_locales" DefaultValue="sv" />
    <InputClaim ClaimTypeReferenceId="claimABC" PartnerClaimType="login_hint" />
    <InputClaim ClaimTypeReferenceId="claimXYZ" PartnerClaimType="login_hint" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="access_token" PartnerClaimType="{oauth2:access_token}" />
    <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" />
    <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="SigBidSwe" />
    <OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="Example-BID-Swe" />
    <OutputClaim ClaimTypeReferenceId="countryCode" DefaultValue="SE" AlwaysUseDefaultValue="true" />

  </OutputClaims>
  <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD"/>
</TechnicalProfile>

但有两个具有相同 PartnerClaimType 的声明不起作用。 B2C 抛出异常。

有没有可能以某种方式实现这一目标?

【问题讨论】:

  • 重复查询字符串有点不寻常。第三方是否可以更改其实施?
  • @AbhishekAgrawal 这将是理想的,但他们不是很热衷于此。
  • 显然B2C不支持重复参数。你能自己定义吗?

标签: azure-active-directory azure-ad-b2c azure-ad-b2c-custom-policy


【解决方案1】:

目前无法使用 Azure B2C 自定义策略完成,而且第三方未遵循规范。

重复的查询参数违反了 OAUTH 规范

  1. 参数

OAuth 协议参数名称和值区分大小写。每个 OAuth 协议参数在每个请求中不得出现超过一次,并且是必需的,除非另有说明。

https://oauth.net/core/1.0a/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多