To adapt this framework wu should create some class models and a controller to manage the authentication and authorization. This is a representation of the standard model recommended by Microsoft:
Authentication Model
Then, we should add the following configuration in the startup class:
Once this is implemented, we can put the Authorize attribute in our controllers to manage who can consume the API. It can be in the controller or for every method because it might be possible that getting a license from a key is open to everybody.
Database
This model makes us create a database to manage users and roles which later will allow us to have the authentication working in the API. Thje database should look lke this:
Authentication DB
This database will be consumed by the Identity Framework to manage authentication and authorization.