Authorizing users based on random database information in ASP.NET Core 6

Viewed 50

I'm working on a system with a client API and a backend API. The client API has login system that interacts with a NetScaler that provides the client (user) with a JWT token.

The token contains one piece of information that is needed to authorize the user and that is located in the roles claims.

Secondly the user also sends in information regarding their location, this however is not in the JWT.

I need to create a authorization that checks the database and checks if the users role matches his location.

The DB table is simple and is just a location/role table:

Location | Role
---------+------------------
England    UserFromEngland

Is this possible to do or not? And if possible how, can I have a example please?

0 Answers
Related