来自Azure B2C和ADFS作为身份提供者的声明

时间:2018-09-11 13:25:57

标签: azure openid adfs azure-ad-b2c

我正在通过OpenID Connect将ADFS用作Azure B2C的IDP。登录有效,但是我没有收到ADFS的任何声明。 这是TrusFrameworkExtensions政策的一部分:

<OutputClaims>
          <OutputClaim ClaimTypeReferenceId="socialIdpUserId" PartnerClaimType="UPN" />
          <OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid" />
          <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="Name" />
          <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
          <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
          <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="contosoAuthentication" />
          <OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="OpenIDADFS" />
        </OutputClaims>

这是我收到的JWT令牌的示例:

{
"exp": 1536674800,
  "nbf": 1536671200,
  "ver": "1.0",
  "iss": "https://login.microsoftonline.com/2263fb1b-1249-4245-a174-cb9d518d7ce3/v2.0/",
  "sub": "f5fa8b7b-5e14-4b49-8f9f-33ea5c8b2149",
 "aud": "21d60a4b-6e33-4e22-b618-586882744560",
 "acr": "b2c_1a_signuporsigninfmdclient",
 "nonce": "defaultNonce",
 "iat": 1536671200,
 "auth_time": 1536671200,
 "idp": "OpenIDADFS",
 "name": "unknown"
}

这里没有要求。 这是我的ADFS设置,包含AD的声明 enter image description here

依赖方政策SignUpOgSignIn

  <RelyingParty>
<DefaultUserJourney ReferenceId="SignUpOrSignInFmdClient" />
<TechnicalProfile Id="PolicyProfile">
  <DisplayName>PolicyProfile</DisplayName>
  <Protocol Name="OpenIdConnect" />
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="displayName" />
    <OutputClaim ClaimTypeReferenceId="givenName" />
    <OutputClaim ClaimTypeReferenceId="surname" />
    <OutputClaim ClaimTypeReferenceId="email" />
    <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
    <OutputClaim ClaimTypeReferenceId="identityProvider" />
  </OutputClaims>
  <SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>

如何收到索赔?

1 个答案:

答案 0 :(得分:2)

对于处理相同或相似问题的其他任何人,必要的步骤是添加<OutputClaim ClaimTypeReferenceId="socialIdpUserId" PartnerClaimType="UPN" />

(根据杰米的评论)

作为参考,B2C自定义策略Azure Sample非常有用。 https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/master/SocialAccounts/TrustFrameworkBase.xml