Hi @Sing Son · Welcome to Q&A platform and thank you for your query.
This is expected. This method is used to create Social/local account in Azure AD B2C directory, which is similar to signed up user (consumer identity) via Signup/Signin user flow. In case of which, the UPN gets generated automatically.
To sign-in via email address and password, you need to use User Flow or Custom Policy in B2C. You will not be able to sign in to Azure/Office365 portal using email address and password of the consumer identities as these identities are not supposed to be used for administration purpose.
If you want to create user for administration purpose and want to specify UPN during creation of the user account, you need to use below method to create a member user account:
POST https://graph.microsoft.com/v1.0/users
Content-type: application/json
{
"accountEnabled": true,
"displayName": "Adele Vance",
"mailNickname": "AdeleV",
"userPrincipalName": "AdeleV@contoso.onmicrosoft.com",
"passwordProfile" : {
"forceChangePasswordNextSignIn": true,
"password": "xWwvJ]6NMw+bWH-d"
}
}
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.