1
votes

I successfully implement Azure AD B2C and get user's first name and last name but I could not figure out a way to get Job Title or Street Address, Office Number. I follow the following code

[PolicyAuthorize(Policy = "b2c_1_sign_in")]
public ActionResult Claims()
{
       Claim displayName = ClaimsPrincipal.Current.FindFirst(ClaimsPrincipal.Current.Identities.First().NameClaimType);
ViewBag.DisplayName = displayName != null ? displayName.Value : string.Empty;
return View();

}

It comes from tutorial https://azure.microsoft.com/en-us/documentation/articles/active-directory-b2c-devquickstarts-web-dotnet/ When I debug the program, I could not find job title or street address. I may need to use AD Graph or something. I check my claim profile on Azure portal. It looks correct. Is there any suggestion?

1
Use a site like jwt.io to have a look inside the issued claim, and make sure the properties are added to the claims in the sign_in policyErik Oppedijk
You are right. I miss some of the properties in the sign_in policy. Thank you very much.Christopher
Please mark as answer, if answer solves your problemKarthikeyan VK

1 Answers

2
votes

You need to select the user attributes - Job Title,Street Address, Office Number in your signup or signin profile then it will be available in your access token.

enter image description here