电子邮件索赔未来自联盟的OIDC ADB2C IDP

发布于 2025-02-07 19:18:36 字数 4013 浏览 3 评论 0原文

我们正在使用B2C,并使用OIDC成功连接了一个广告联合会,这一切都很好。但是,我们希望启用外部B2C IDP实例以实现另一个联合会。我们配置了主机B2C与AD One相同,从联邦来源获取电子邮件,FirstName,姓氏。

这是技术配置文件,以在我们的base.xml文件中启用联邦

<ClaimsProvider>
  <Domain>testdomain</Domain>
  <DisplayName>Login using External Tenant</DisplayName>
  <TechnicalProfiles>
    <TechnicalProfile Id="TestDomain">
      <DisplayName>Test domain</DisplayName>
      <Description>Login with your test domain account</Description>
      <Protocol Name="OpenIdConnect"/>
      <Metadata>
        <Item Key="METADATA">Link to the federated tenant well known endpoint</Item>
        <Item Key="client_id">xxx</Item>
        <Item Key="response_types">code</Item>
        <Item Key="scope">openid email profile</Item>
        <Item Key="response_mode">form_post</Item>
        <Item Key="HttpBinding">POST</Item>
        <Item Key="UsePolicyInRedirectUri">false</Item>
        <Item Key="ClaimTypeOnWhichToEnable">identityProviders</Item>
        <Item Key="ClaimValueOnWhichToEnable">testdomain</Item>
      </Metadata>
      <CryptographicKeys>
        <Key Id="client_secret" StorageReferenceId="testdomain"/>
      </CryptographicKeys>
      <InputClaims>
        <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="login_hint" />
      </InputClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid"/>
        <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
        <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
        <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
        <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" AlwaysUseDefaultValue="true" />
        <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
        <OutputClaim ClaimTypeReferenceId="objectIdExternalTenant" PartnerClaimType="sub" />
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="federatedGivenName" PartnerClaimType="given_name" DefaultValue="Not Set"/>            
        <OutputClaim ClaimTypeReferenceId="federatedSurname" PartnerClaimType="family_name" DefaultValue="Not Set"/>      
        <OutputClaim ClaimTypeReferenceId="federatedDisplayName" PartnerClaimType="name" DefaultValue="Not Set"/>     
        <OutputClaim ClaimTypeReferenceId="federatedIDPEmailAddress" PartnerClaimType="email" DefaultValue="Not Set"/>     
      </OutputClaims>
      <OutputClaimsTransformations>
        <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName"/>
        <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName"/>
        <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId"/>
        <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId"/>
      </OutputClaimsTransformations>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin"/>
      <EnabledForUserJourneys>OnItemExistenceInStringCollectionClaim</EnabledForUserJourneys>
    </TechnicalProfile>
    

,这是在联邦IDP端的应用程序注册的设置。注意设置说您只能启用OpenID和Offline_Access范围。

请参阅附件的图片 fed1 fed2

当我们通过家庭域中登录时,它将我们带到联盟的IDP,我们将登录到此,但是我们无法将电子邮件索赔回到那里,fived_name,family_name,name,sub都在那里,但没有填充电子邮件索赔。有什么想法为什么这种说法不会通过吗?

提前致谢。

We are using B2C and have successfully connected an AD federation using OIDC, that all works fine. However, we want to enable an external B2C IdP instance to enable another federation. We configured our host B2C the same as the AD one, getting the email, firstname, surname from the federation source.

Heres the technical profile to enable federation in our base.xml file

<ClaimsProvider>
  <Domain>testdomain</Domain>
  <DisplayName>Login using External Tenant</DisplayName>
  <TechnicalProfiles>
    <TechnicalProfile Id="TestDomain">
      <DisplayName>Test domain</DisplayName>
      <Description>Login with your test domain account</Description>
      <Protocol Name="OpenIdConnect"/>
      <Metadata>
        <Item Key="METADATA">Link to the federated tenant well known endpoint</Item>
        <Item Key="client_id">xxx</Item>
        <Item Key="response_types">code</Item>
        <Item Key="scope">openid email profile</Item>
        <Item Key="response_mode">form_post</Item>
        <Item Key="HttpBinding">POST</Item>
        <Item Key="UsePolicyInRedirectUri">false</Item>
        <Item Key="ClaimTypeOnWhichToEnable">identityProviders</Item>
        <Item Key="ClaimValueOnWhichToEnable">testdomain</Item>
      </Metadata>
      <CryptographicKeys>
        <Key Id="client_secret" StorageReferenceId="testdomain"/>
      </CryptographicKeys>
      <InputClaims>
        <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="login_hint" />
      </InputClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid"/>
        <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
        <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
        <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
        <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" AlwaysUseDefaultValue="true" />
        <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
        <OutputClaim ClaimTypeReferenceId="objectIdExternalTenant" PartnerClaimType="sub" />
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="federatedGivenName" PartnerClaimType="given_name" DefaultValue="Not Set"/>            
        <OutputClaim ClaimTypeReferenceId="federatedSurname" PartnerClaimType="family_name" DefaultValue="Not Set"/>      
        <OutputClaim ClaimTypeReferenceId="federatedDisplayName" PartnerClaimType="name" DefaultValue="Not Set"/>     
        <OutputClaim ClaimTypeReferenceId="federatedIDPEmailAddress" PartnerClaimType="email" DefaultValue="Not Set"/>     
      </OutputClaims>
      <OutputClaimsTransformations>
        <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName"/>
        <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName"/>
        <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId"/>
        <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId"/>
      </OutputClaimsTransformations>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin"/>
      <EnabledForUserJourneys>OnItemExistenceInStringCollectionClaim</EnabledForUserJourneys>
    </TechnicalProfile>
    

Here's the setup for the app registration on the federation idp side. Note the settings saying you can only enable openid and offline_access scopes.

See attached pictures
fed1
fed2

When we login through our home realm discover page, it takes us to the federated Idp, we login to that but we cannot get the email claim back, given_name, family_name, name, sub are all there but it doesn't populate the email claim. Any ideas why this claim won't come through?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬 2025-02-14 19:18:36

而不是“ 电子邮件”,而是尝试“ signinnames.emailaddress ”。

搜索您的 trustframeworkbase.xml 文件中的“ signInnames.emailAddress ”,以确认它在那里。

这是用户属性列表:

https:> https: //learn.microsoft.com/en-us/azure/active-directory-b2c/user-profile-attributes

Instead of "email", try "signInNames.emailAddress".

Search your TrustFrameworkBase.xml file for "signInNames.emailAddress" to confirm that it is there.

Here is a list of user attributes:

https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-profile-attributes

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文