There is a MVC project and a separate WebApi project. Access to the database is fully realized through WebApi (including authorization and authentication). That is, in this case, MVC is a client, WebApi is a server.
There was a question how to correctly implement authorization and authentication in the MVC project (on the client side). I read a lot how it is implemented in WebApi (via a token), but I can’t understand how to correctly use this token in MVC.
To make a wrapper to each request? I also don’t know how to define a user role in MVC. Maybe there is some possibility to remake the standard MVC authorization methods for working with a token? Will the Autorize attributes Autorize on the MVC client side? Please poke into some kind of example of such an implementation if possible, or tell me how best to implement it.