1

I am setting up a new Azure AD B2C directory with standard sign-in user policy. I plan to have the user accounts created by an administrator so sign-up policy is not required. My issue is that I want to return the email address created for a user account however when I test the user flow the email address is the only claim that's missing. Is there are reason for this and a way around it?

Test user account with email address populated. enter image description here

IDP settings enter image description here

enter image description here

User flow application claims settings enter image description here

Claims return when testing user flow enter image description here

OjM
  • 1,029
  • 2
  • 17
  • 32

1 Answers1

2

B2C built-in user flow mainly collects the email addresses from 2 positions of the local account.

One is otherMails (Microsoft Grpah) / Alternate email(Azure Portal).

enter image description here

The other is the identity whose signInType is emailAddress (Microsoft Graph).

enter image description here

So if your local account is signed up with "User ID" option, there is no identity whose signInType is emailAddress. And if the otherMails (Microsoft Grpah) / Alternate email is also not set, there won't be any emails claim in the token.

Please update the properties I mentioned (otherMails / Alternate email or use email address to sign up / add an identity whose signInType is emailAddress using Microsoft Graph) to make them be included in the token.

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
  • thanks that worked. I am also interested in returning the user principal name ("test" in my screenshot above) so that I can pre-populate the login_hint property when re-authenticating the user. However this claim does not seem to exist which is strange. Do you know if it's possible to return the upn claim with above scenario? – OjM Jun 01 '21 at 07:04
  • 1
    @OjM I think it's impossible. See a similar issue here: https://stackoverflow.com/questions/63601519/aad-b2c-missing-upn-claim-in-access-token?answertab=votes#tab-top. – Allen Wu Jun 01 '21 at 07:31