2

I'm looking to see if it's possible to use both individual user accounts authentication along side Azure AD authentication in a single application. Either Framework or Core (ASP.NET).

So far it's been all Google searching and I'm not finding anything that clearly states one can do this. Secondly, I'm not very familiar with authenticating an application aside from the basics for both individual or azure ad (well documented examples / VS template code).

Any help, links, small code example from Startup.cs is greatly appreciated.

Thanks.

  • See **Microsoft.Identity.Client** and **Microsoft.Extensions.Identity.Core** NuGet package. – vernou Sep 02 '20 at 15:21

1 Answers1

3

It's too vast topic to put into an answer as a how-to-guide. However, I would try to give you brief overview and enough references/examples to look at. Your scenario can be better solved by using Azure AD B2C in conjunction with Azure AD. I strongly suggest you to go through the overview from those links for foundational concepts first. Azure AD B2C provides business-to-customer identity as a service. Your customers use their preferred social, enterprise, or local account identities to get single sign-on access to your applications and APIs.

In your case, you need to add Azure AD as identity provider in the B2C tenant, and add required User flow (personal/social login) which will enable your user to login with either organizational (AAD) or personal/social account by signing up. This explains how to configure custom policies in B2C to add AAD as identity provider in such case. And for example, this provides you guide to enable Azure AD and Facebook login.

Now coming to code/SDK part, since you are into C# and asp.net, your one stop shop should be the new Microsoft Identity Web library. It would make your life lot easier to wire up with Microsoft Identity Platform with minimal configuration and code, and also has pretty good documentation, reference and samples to handle most common scenario. For example, this is a sample for B2C. There are many more here for your reference in case you need.

I would emphasize your starting point should be Microsoft Identity Web for asp.net core.

krishg
  • 5,935
  • 2
  • 12
  • 19
  • I have a quite similar question and struggling to find an answer. https://stackoverflow.com/questions/67571416/blazor-wasm-implement-both-individual-user-accounts-and-azure-ad-authenticatio Can you advise? – Rahul May 17 '21 at 14:19