I have a blazor server application with active directory authentication. (Windows accounts) Now I need to add roles to logged users. These roles are custom, and are stored in a database so I can get all roles for a particular user.
I've been investigating and for blazor webassembly I can implement the AccountClaimsPrincipalFactory
which contains a method called CreateUserAsync
. This method is invoked when the user is logged in the app. I was thinking maybe I can create the ClaimsPrincipal here, invoke services to get the custom roles for the user. Then add all this information to the user claims. That will work but I'm in blazor server not webassembly.
My question is, which is the equivalent to this procedure in blazor server? I need some guidance to get started.