Can Azure AD B2C coexist with OWIN Identity?

Prateek Rathore 21 Reputation points
2022-10-04T08:24:04.49+00:00

The current app I'm working on uses Microsoft.AspNet.Identity.Owin with SignInManager and UserManager.
It also uses Microsoft.AspNet.Identity to get the currently signed in user. The users are stored in the database using the dbo.AspNetUsers. Also roles and rights are defined in the database.

Is it possible to link the 2 so that when you're logged in with Azure AD B2C, you will also be logged in on the current Identity?

@AmanpreetSingh-MSFT

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,367 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,156 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,639 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 33,801 Reputation points Microsoft Employee
    2022-10-05T00:08:26.063+00:00

    Hi @Prateek Rathore ,

    Yes, you can use OWIN in B2C. We have the new Microsoft.Identity.Web v2.0-preview integration guide that goes over some of the considerations on the B2C side. https://github.com/AzureAD/microsoft-identity-web/wiki/v2.0#owin

    We also have the guide, B2C with OpenID Connect.

    I believe the issue with your implementation is that the data in dbo.AspNetUser needs to be migrated to the tables used by the new ASP.NET Core 2.0 Identity schema, as discussed here. https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/membership-to-core-identity?view=aspnetcore-6.0

    See related posts:

    Migrate an OWIN-based web API to b2clogin.com or a custom domain
    B2C login for end users
    B2C SSO with OWIN
    How to integrate an older ASP.NET site with Azure AD B2C?

    Let me know if this helps and if you have further questions! I've added the dotnet tag to this thread too since that team supports OWIN issues.

    -

    If the information helped you, please accept the answer. This will help us and other community members as well.

    0 comments No comments