How to programmatically (or manually by using user flow for edit) change validated email while using signup sign in flow with sign in type is username in Azure AD B2C

2023-07-11T03:33:43.35+00:00

I have set up the signup sign in flow in Azure B2C using recommended version and use Local accounts User ID signup option, which in the flow, user have to validated email before sign up.

First, I tried to retrieve validated email from Graph API which is not in user Identities

"Identities": [
        {
          "AdditionalData": {},
          "BackingStore": {
            "InitializationCompleted": false,
            "ReturnOnlyChangedValues": false
          },
          "Issuer": "xxxxx.onmicrosoft.com",
          "IssuerAssignedId": "testuser",
          "OdataType": null,
          "SignInType": "userName"
        },
        {
          "AdditionalData": {},
          "BackingStore": {
            "InitializationCompleted": false,
            "ReturnOnlyChangedValues": false
          },
          "Issuer": "xxxxx.onmicrosoft.com",
          "IssuerAssignedId": "xxxxx.onmicrosoft.com",
          "OdataType": null,
          "SignInType": "userPrincipalName"
        }
      ],

but I finally found the validated email was in EmailAuthenticationMethod but I can't update it via Graph API (error as below)

Microsoft.Graph.Models.ODataErrors.ODataError: Exception of type 'Microsoft.Graph.Models.ODataErrors.ODataError' was thrown.    at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponse(HttpResponseMessage response, Dictionary`2 errorMapping, Activity activityForAttributes)

In which in this thread, Alfredo said the user is not consumer account, which make me confuse because it was create by default signup signin flow and even manually created user

(user info in Azure AD B2C)User info in AD

(When I manually created)Manually created options

It will be perfect if user validated email can be update programmatically, or any user flow which can edit this email will be welcome.

Thanks.

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.
3,020 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.