I'm just getting started with ASP.net and Identity, I used to develop with PHP. I currently have a database with a Users table and a Companies table. This is a stock system that has about five companies but the stock can move from company to company. The user is also related to there companies, the exact relation between user and company is many to many. What I am trying to do is authorize only certain API calls if the user is logged in and has picked a company. Also when a change is made the company ID they have logged in with needs to be referenced. I am planning on using IdentityServer for the user logging in and out but how would I get this to work with companies as well?
Finally I need to be able to set the role of a user in a specific company as opposed to the role in the whole app and then block certain api calls based on that.
Sorry if this question is confusing, still trying to work out if ASP.Net is right for me.
P.S I'm just EFCore as well