.NET 8 core MVC app with AAD (or other external) login and authorisation in local tables

Richard Scannell 301 Reputation points
2024-02-09T11:44:57.3+00:00

Are there any examples of asp.net CORE 8 apps or tutorials which let you use Azure AD / Entra ( or other external login for authentication, but which build roles from a database's local tables eg AspNetRoles, AspNetUserRoles?
Additionally are there any sample applications which maintain these tables.

Planned scenario is to use AAD to login to an app & for the username returned eg me@MyAADomain.com to look up in AspNetUserRoles to return if I am an Admin, Editor or whatever custom roles we have for the app.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,023 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,185 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,531 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,579 questions
{count} votes

Accepted answer
  1. AgaveJoe 25,761 Reputation points
    2024-02-09T13:30:45.0733333+00:00

    MVC application take advantage of an authentication cookie to identify the user. You can modify the cookie however you like. Use cookie authentication without ASP.NET Core Identity If you are Identity, it supports external logins. https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/?view=aspnetcore-8.0&tabs=visual-studio


0 additional answers

Sort by: Most helpful