How authorize a web API using a cookie based authentication

248 Views Asked by At

I had a MCV core app that uses cookie based authentication (stores user credentials in DB). Later I introduced a web api as the backend of this MVC application. Now both are hosted together as a Azure web app. For now my cookie authentication logic is still in the MVC application. So what is the simplest approach for me to secure the web api.

1

There are 1 best solutions below

0
On

I simply used the Authorize attribute in my API controllers and that resolved the issue.