Azure AD B2C Linkedin索赔提供者 [英] Azure AD B2C Linkedin claims provider

查看:63
本文介绍了Azure AD B2C Linkedin索赔提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过自定义策略实现Linkedin的登录/登录,但是当我单击LinkedinExchange按钮时,我从User Journey Player中收到以下异常:

I am implementing the Linkedin sign-up/sign-in via custom policies but when I click on the LinkedinExchange button, I get the following exception from the User Journey Player:

向URL"

An exception was caught when making a request to URL "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,formatted-name,email-address)" using method "Get". The exception status code was "ProtocolError" with the following message: The remote server returned an error: (401) Unauthorized.. The remote server returned an error: (401) Unauthorized.

这是我添加的Linkedin的ClaimsProvider:

Here is the ClaimsProvider for Linkedin I added:

<ClaimsProvider>
  <Domain>linkedin.com</Domain>
  <DisplayName>Linkedin</DisplayName>
  <TechnicalProfiles>
    <TechnicalProfile Id="Linkedin-OAUTH">
      <DisplayName>Linkedin</DisplayName>
      <Protocol Name="OAuth2" />
      <Metadata>
        <Item Key="ProviderName">linkedin</Item>
        <Item Key="authorization_endpoint">https://www.linkedin.com/oauth/v2/authorization</Item>
        <Item Key="AccessTokenEndpoint">https://www.linkedin.com/oauth/v2/accessToken</Item>
        <Item Key="AccessTokenResponseFormat">json</Item>
        <Item Key="ClaimsEndpoint">https://api.linkedin.com/v1/people/~:(id,first-name,last-name,formatted-name,email-address)?format=json</Item>
        <Item Key="HttpBinding">POST</Item>
        <Item Key="UsePolicyInRedirectUri">0</Item>
        <Item Key="client_id">XXXXXXXXXXXX</Item>
      </Metadata>
      <CryptographicKeys>
        <Key Id="client_secret" StorageReferenceId="B2C_1A_LinkedinSecret" />
      </CryptographicKeys>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="socialIdpUserId" PartnerClaimType="id" />
        <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="emailAddress" />
        <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="firstName" />
        <OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="lastName" />
        <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="formattedName" />
        <OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="Linkedin" />
        <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="Linkedin" />
      </OutputClaims>
      <OutputClaimsTransformations>
        <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
        <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
        <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
        <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" />
      </OutputClaimsTransformations>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
    </TechnicalProfile>
  </TechnicalProfiles>
</ClaimsProvider>

有人看到我在做什么错吗?

Does someone see what I am doing wrong ?

推荐答案

为了通过自定义策略将LinkedIn添加为Azure AD B2C中的身份提供者,请确保您在ClaimsProvider的<Metadata>部分中具有以下条目:

In order to add LinkedIn as an Identity Provider in Azure AD B2C via custom policies, make sure you have the following entry in the ClaimsProvider's <Metadata> section:

<Item Key="ClaimsEndpointAccessTokenName">oauth2_access_token</Ite‌​m>

这篇关于Azure AD B2C Linkedin索赔提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆