Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure AD B2C - Use Graph API to populate "Authentication Email"

Is there a way we can populate the “Email” field for the user via Graph API in Azure AD B2C. There is a section “Authentication contact info” under the user profile, which has a field “Email” which is a read-only field when accessed via Graph API and cannot be populated programmatically. I am able to use Graph API to populate the “Alternate email”. However for the reset password policy (user clicks the forgot password link), the “Email” field is a required field I am unable to use the “Alternate email” in the reset password policy

Screenshot of the Email field that needs to populate via Graph API

like image 889
CaCoFoNiX Avatar asked Jan 04 '18 19:01

CaCoFoNiX


People also ask

Can I use Azure AD for authentication?

Azure AD provides secure authentication and authorization solutions so that customers, partners, and employees can access the applications they need. With Azure AD, conditional access, multi-factor authentication, single-sign on, and automatic user provisioning make identity and access management easy and secure.

What is passthrough authentication?

The pass-through mechanism authenticates a user on the authenticating server, even if the user entry or password is on a different server. You can run a bind or compare operation against the authenticating server, even if the user entry or the credential is not on the server.

How does it authenticate users with Azure AD B2C?

It authenticates users with Azure AD B2C. It acquires an access token with the required permissions (scopes) for the web API endpoint. It passes the access token as a bearer token in the authentication header of the HTTP request by using this format: The web API does the following:

Does Azure AD support B2C user migration using Microsoft Graph API?

This functionality isn't exposed through the Microsoft Graph API, but through the Azure REST API. For more information, see B2C Tenants - Create. Watch this video to learn about Azure AD B2C user migration using Microsoft Graph API.

What can I do with the Azure AD graph API?

These types of tasks require the ability to create, read, update and delete user accounts - which you can do using the Azure AD Graph API. For B2C tenants, there are primarily two modes of communicating with the Graph API.

What is the example of custom email verification in Azure AD B2C?

The is a working example of the sample reference on the Microsoft B2C documentation site - Custom email verification in Azure Active Directory B2C Integrate a custom SMS provider in Azure Active Directory B2C (Azure AD B2C) to customized SMS' to users that perform multi factor authentication to your application.


2 Answers

Only Authentication contact info: Alternate email can be modified via the Azure AD Graph at this time. You can achieve this by sending a Patch request as follows:

PATCH https://graph.windows.net/yourtenant.com/users/[email protected]
{
  "otherMails": [
    "[email protected]"
  ]
}

The Authentication contact info: Email field is only editable via the portal at this time.

like image 122
Saca Avatar answered Oct 27 '22 15:10

Saca


Seems like Authentication contact info: Email field is NOT editable even via the portal now. Not sure what changed in the Azure AD B2C infrastructure. Anyone know of any other work around to edit the Authentication contact info: Email field. Our users are unable to reset their password ... Any help is greatly appreciated

like image 41
CaCoFoNiX Avatar answered Oct 27 '22 14:10

CaCoFoNiX