简体   繁体   English

Azure B2C 自定义策略 Microsoft Live.com 帐户 - 获取图片

[英]Azure B2C custom policy Microsoft Live.com Account - Get Picture

I try to get user image for MSA-OIDC TechnicalProfiles, but it's not working.我尝试获取 MSA-OIDC TechnicalProfiles 的用户图像,但它不起作用。 Somebody will help me?有人会帮助我吗? This is my Claims Provider.这是我的索赔提供者。 For google and facebook this solution working perfectly.对于 google 和 facebook,此解决方案运行良好。 I will add that in Azure Ad Application I added permission for User.Read, email, profile .我将在 Azure 广告应用程序中添加,我添加了User.Read, email, profile的权限。 It's enough?够了吗?

        <ClaimsProvider>
          <Domain>live.com</Domain>
          <DisplayName>Microsoft</DisplayName>
          <TechnicalProfiles>
            <TechnicalProfile Id="MSA-OIDC">
              <DisplayName>Sign in with Microsoft</DisplayName>
              <Protocol Name="OpenIdConnect" />
              <Metadata>
                <Item Key="ProviderName">https://login.live.com</Item>
                <Item Key="METADATA">https://login.live.com/.well-known/openid-configuration</Item>
                <Item Key="response_types">code</Item>
                <Item Key="response_mode">form_post</Item>
                <Item Key="scope">openid profile email</Item>
                <Item Key="HttpBinding">POST</Item>
                <Item Key="UsePolicyInRedirectUri">false</Item>
                <Item Key="client_id">************************</Item>
              </Metadata>
              <CryptographicKeys>
                <Key Id="client_secret" StorageReferenceId="B2C_1A_MSASecret" />
              </CryptographicKeys>
              <OutputClaims>
                <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="oid" />
                <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
                <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
                <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
                <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" />
                <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
                <OutputClaim ClaimTypeReferenceId="email" />
                <OutputClaim ClaimTypeReferenceId="picture" PartnerClaimType="picture" />
              </OutputClaims>
              <OutputClaimsTransformations>
                <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
                <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
                <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
              </OutputClaimsTransformations>
              <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
            </TechnicalProfile>
          </TechnicalProfiles>
        </ClaimsProvider>

• I didn't use the claims provider class as posted by you in the question, but I followed the Github solution as given below in the link and I successfully signed with the Microsoft account through the 'Signin or Signup' userflow. • 我没有使用您在问题中发布的索赔提供商 class,但我遵循了链接中给出的 Github 解决方案,并且我通过“登录或注册”用户流程成功使用 Microsoft 帐户进行了签名。 Also, I tried to signup using the Identity Experience Framework also through the custom policy and was successful in creating a Microsoft account in Azure AD B2C during signup.此外,我还尝试通过自定义策略使用身份体验框架进行注册,并在注册期间成功在 Azure AD B2C 中创建了 Microsoft 帐户。 Please find the link below for your reference: -请找到以下链接供您参考:-

https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/active-directory-b2c/identity-provider-microsoft-account.md https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/active-directory-b2c/identity-provider-microsoft-account.md

Microsoft account signup option through custom policy used from the above link: -通过上述链接使用的自定义策略的 Microsoft 帐户注册选项:-

微软帐户注册

Also, for getting the profile picture image of Microsoft account in Azure B2C, you will have to already import the profile picture of that user in Azure B2C because there is no way to get the profile photo of a Microsoft account in Azure B2C even through custom policy. Also, for getting the profile picture image of Microsoft account in Azure B2C, you will have to already import the profile picture of that user in Azure B2C because there is no way to get the profile photo of a Microsoft account in Azure B2C even through custom政策。 Also, please take note of the points in the link below: -另外,请注意以下链接中的要点:-

https://docs.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0#to-retrieve-the-profile-photo-of-a-contact https://docs.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0#to-retrieve-the-profile-photo-of-a-contact

The community thread link below states some probable steps that you can carry out in case of getting the profile user image: -下面的社区线程链接说明了一些可能的步骤,您可以在获取个人资料用户图像的情况下执行这些步骤:-

Get User profile pic using custom policy with azure B2C 使用 azure B2C 的自定义策略获取用户配置文件图片

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM