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
.NET 8 core MVC app with AAD (or other external) login and authorisation in local tables
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.
Many thanks for this. This has been a great way to link my AAD login with the ASPNETUsers table. Are there any tutorials for the 2nd part of my question ( ideally with samples) on maintaining the the AspNetRoles & AspNetUserRoles tables and presenting a role to a dataannotations filter ?
Sign in to comment