I have an ASP.net core solution that contains 2 projects and I want to add authentication for both of them:
- I want the web app to use cookies-based authentication because it's easy to add.
- But when I call an API from the ApiAuth project I want to be authenticated to use it.
WebAuth project contains the basic authentication (login, register...) but I can call ApiAuth project Apis without being authenticated. how can protect the ApiAuth project APIs? I tried adding [Authorize] decorator but I am getting this error:
So I am thinking about adding a JWT authentication but I don't know if it's the correct thing to do or not? Any suggestions, please?

