18

We are looking at using Azure AD B2C in an application and I am confused about which package to use when working with Azure AD B2C.

This question discusses the difference between the MSAL and ADAL library: MSAL or ADAL library for use with Azure AD B2C and Xamarin.

In addition to that, there is now a warning on the Azure AD Graph API reference to instead use the Microsoft Graph API. None of the examples for B2C seem to use Microsoft Graph API and there appears to be no description of the level of support for Microsoft Graph with B2C.

I need to be able to create users with custom attributes in B2C and then query them using a Graph API.

What is the correct package to use to interact with Azure AD B2C and are there examples that show how this is done?

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
TaintedLemon
  • 648
  • 8
  • 17

1 Answers1

19

As of today, we recommend that you use the Azure Active Directory Graph API https://graph.windows.net to access and manage your B2C tenants.

Azure AD B2C: Use the Graph API

If you read this article, you can learn more about the gaps between AAD and Microsoft Graph API: https://dev.office.com/blogs/microsoft-graph-or-azure-ad-graph

The bottom line in the table states:

  1. Manage users in B2C tenant (set local accounts, sign in names)

Coming soon (preview)

The rest of this article should hopefully help people decide which API to use today. Ultimately, everything will make it's way to Microsoft Graph... it will just take a little time.

Let me know if this helps!

Shawn Tabrizi
  • 12,206
  • 1
  • 38
  • 69
  • 4
    hmm.. in the [article](https://dev.office.com/blogs/microsoft-graph-or-azure-ad-graph) referenced: "Even with those gaps, we strongly recommend that developers start using Microsoft Graph over Azure AD Graph" – spottedmahn Aug 08 '17 at 15:07
  • 3
    I agree with that statement. You should use Microsoft Graph wherever and whenever your scenario is supported. In the case of managing users in B2C tenants, this is not even an option today. – Shawn Tabrizi Aug 08 '17 at 15:27
  • Are the two compatible? I can't get bearer tokens generated via B2C to authenticate with the graph API – James South Nov 14 '18 at 22:26
  • 1
    How have things changed now, several years later? – Lars Kemmann Dec 24 '20 at 15:55
  • 2
    @LarsKemmann As of today we can mostly manage Azure AD B2C users with Microsoft Graph. Some pain points include: "The $count and $search parameters are currently not available in Azure AD B2C tenants." which also means that we cannot use the $orderby clause. – IdusOrtus Feb 18 '21 at 16:30
  • The lack of $count and $search in B2C directories is still a massive issue a year later. – Patrick Borkowicz Feb 08 '22 at 03:47