Where is stored the signin email after manually creating a b2c user and why does validation work this way?

Eric Gagnon 21 Reputation points
2022-09-16T17:50:29.607+00:00

Hello,

I dont understand that behavior in Azure b2c:

1) Create a new b2c user manually. Asssign sign in method email (a email) and username (not a email, just a username)

2) save the user.

3) Where is the email now? Email is also not visible using https://graph.microsoft.com/v1.0/users but the email will work anyway when testing using a login flow.

![241889-image.png][2]

Also, note that I was able to assign a username without domain but if I try to edit the user after the creation there is a now a constraint forcing a domain assignation. Why?

241964-image.png [2]: /api/attachments/241889-image.png?platform=QnA

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,639 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Shweta Mathur 27,381 Reputation points Microsoft Employee
    2022-09-27T08:11:45.477+00:00

    Hi @Eric Gagnon ,

    Thanks for reaching out and apologies for delay in response.

    I understand you are trying to add B2C manually using username and email sign in method, but not able to see email signIn value in the Azure portal.

    Azure portal is not supported signInTypes as shown below:

    245061-image.png

    You can retrieve signInTypes details of user from Graph API endpoint https://graph.microsoft.com/beta/users/<objectId of the user>

    UPN is mandatory for AAD accounts. In the B2C, email or username is used and never UPN. In the graph API, UPN value is different than what is reflecting in the portal as UPN is an irrelevant random string in the B2C and that's the reason you are not allowed to update the UPN in the portal as well.

    245071-image.png

    However, there are ways to update UPN using powershell command:

    1. Connect-AzureAD
    2. Get-AzureADUser -ObjectId <ObjectID of the User> | fl
    3. Set-AzureADUser -ObjectId <ObjectID of the User> -UserPrincipalName <New name>

    Updating the UPN will not update the signInTypes and you will be able to siginIn using email and username.

    Hope this will help.

    Thanks,
    Shweta

    ----------------------------------

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

  2. Eric Gagnon 21 Reputation points
    2022-09-30T16:25:16.887+00:00

    Thanks for follow up.

    "In the B2C, email or username is used and never UPN."

    So why does b2C user create in portal assign UPN field with username? (wrong value that cannot be corrected through portal, only using graph api)

    https://learn.microsoft.com/en-us/answers/questions/1014215/confused-by-inconsistency-while-creating-a-b2c-use.html

    0 comments No comments