Is there a way to change the default username in Azure AD B2C while using custom policies?

Deep_Azure9 46 Reputation points
2022-08-23T05:29:23.197+00:00

Hello,

We have implemented Azure AD B2C Custom Policies with Mobile Number ( as Username) and Password for user authentication. Now there is a need to change Mobile Number of the user. Is there a way to change the username of user ?

Please help us as soon as possible.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,794 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 42,071 Reputation points
    2022-08-23T07:49:44.53+00:00

    Hi,

    Thank you for asking this question on the Microsoft Q&A Platform.

    It depends upon the type of the user account is created, so work account, Guest account or Consumer account? There are couple of ways for the account can be updated, please check this article and follow the relevant steps for the specific type of user.

    user-overview

    ==
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. 2022-09-02T05:33:48.967+00:00

    Hello @Deep_Azure9 and thanks for reaching out. The username is stored in one of the user identities. You can update it using MS Graph with a query similar to this one:

       PATCH https://graph.microsoft.com/beta/users/{id}  
         
       {  
           "identities": [  
               {  
                   "signInType": "phoneNumber",  
                   "issuer": "string",  
                   "issuerAssignedId": "string"  
               },  
               {  
                   "signInType": "userPrincipalName",  
                   "issuer": "string",  
                   "issuerAssignedId": "string"  
               }  
           ]  
       }  
    

    For more information take a look to Update user.
    Also, to the Microsoft Graph SDK with is available for 7 programming languages.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.

    0 comments No comments