Pytry
Pytry

Reputation: 6409

Azure AD B2C: Change Local Email

I have two requirements that seem to conflict:

  1. Use the email as the username.
  2. Allow users to change their email.

The problem: if you configure the directory to use the email as the username then the edit profile policy does NOT show the email to allow you to change it.

Any solution I think of is a kludge and involves creating a whole new local account for the user.

Any ideas or suggestions?

Upvotes: 6

Views: 11001

Answers (3)

bvwidt
bvwidt

Reputation: 393

The possibilities have changed and @pswillies answer is not true anymore. It is possible to change the sign-in name of local accounts where the sign-in name is an email address.

See this official sample: https://github.com/azure-ad-b2c/samples/tree/master/policies/change-sign-in-name

It is using custom policies.

Upvotes: 3

tank104
tank104

Reputation: 452

You can do this via Microsoft Graph now too. Example:

PATCH: https://graph.microsoft.com/v1.0/users/{UUID}
{
    "identities": [
        {
            "signInType": "emailAddress",
            "issuer": "xxxx.onmicrosoft.com",
            "issuerAssignedId": "{new email address}"
        }
    ]
}

Upvotes: 6

pswillies
pswillies

Reputation: 136

You'll need to use the Azure AD Graph API to update the 'User' entity.

Upvotes: 3

Related Questions