Search code examples
c#asp.net-coreasp.net-identityidentityserver4

IdentityServer4 storing users in a database without EF and handling massive Authorization scenarios


I'm building a core mvc application to support several sub applications so they can run on several IIS servers

I don't like using EF much due to the complications of the migration especially in production, therefore I need to write my own User handling mechanism and I'd like to know what are my best options if I need to have a massive role or authorization checks that might reach to thousands of roles. I need to secure stuff like:

  • APIs
  • Controllers
  • Clients or Whole MVC/JS Web Apps and Mobile Devices Clients
  • User Specific access (ex: User can access his own division data, some with read some with write)

.. and lots of lots of authorization scenarios that will work with (User.IsInRole method or the Authorize Attribute) across this multi-server/domain solution.

I need your guidance on how to achieve this following the best practices.


Solution

  • Regarding not using EF. All the "stores" in IDS4 are abstractions so you can implement your own for each IDS4 entity (rather than using the EF bolt on) and likewise you can implement your own IProfileService and IClaimsService to use whatever backend you'd like.