Azure B2C: Default Display Name

2019-05-14 03:53发布

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"?

2条回答
Rolldiameter
2楼-- · 2019-05-14 04:30

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>
查看更多
劫难
3楼-- · 2019-05-14 04:36

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

查看更多
登录 后发表回答