Azure B2C: Default Display Name

孤人 提交于 2019-12-22 10:15:57

问题


Our Sys Admins want to be able to search for users and identify them by their Given Name and Surname, both of which we are collecting/requiring when they sign up.

We are NOT allowing users to specify a "Display Name" value when they create an account.

The management portal uses the "Display Name" as one of the three columns displayed in the "Users" pane.

It would be useful for Systems Administrators to be able to see the values given for Surname and Given Name in the user management portal to be able to identify the correct account.

I do know that there is a filter/search that I can type keywords into, and it does in fact find accounts with first or last names matching those, but if their name does not show in the "User Name" (which has been set to be the email), it is difficult to be sure of a match.

I could write code to update the display name using the graph API when we receive a connection from a new account, but I'd rather not.

Is it possible to configure the Display Name to use the "Given Name" + "Surname" values when viewing the list of users that have created B2C accounts?

Or perhaps, is it possible to show other attributes as columns as well as or instead of "Display Name"?


回答1:


I fix that with a Web Job and Graph API. If that is an option for you I'm happy to share the code.




回答2:


I use Azure B2C custom policy for signup process and had the same requirement - DisplayName = FirstName + LastName. I use claims transformation to achieve that.

<ClaimsTransformations>
  <ClaimsTransformation Id="CreateDisplayNameFromFirstNameAndLastName" TransformationMethod="FormatStringMultipleClaims">
    <InputClaims>
      <InputClaim ClaimTypeReferenceId="givenName" TransformationClaimType="claim1" />
      <InputClaim ClaimTypeReferenceId="surname" TransformationClaimType="claim2" />
    </InputClaims>
    <InputParameters>
      <InputParameter Id="stringFormat" DataType="string" Value="{0} {1}" />
    </InputParameters>
    <OutputClaims>
      <OutputClaim ClaimTypeReferenceId="displayName" TransformationClaimType="outputClaim" />
    </OutputClaims>
  </ClaimsTransformation>
</ClaimsTransformations>


来源:https://stackoverflow.com/questions/37668121/azure-b2c-default-display-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!