In the old days, web applications were treated as one. There was no separation between frontend and backend apps — at least not like today. The reason was that back then, computers were not as powerful as they are today. Browsers used to rely on servers to render the frontend and return it as simple HTML. This technique is called server-side rendering. These kinds of mindsets are what gave rise to frameworks like ASP.NET Web Forms.

But as innovations in computing increased rapidly, modern computers became much more powerful than they used to be. This has allowed them to render more client-side code.

Thus, modern apps tend to benefit from this by implementing client-side rendering. I’m sure you have heard of JavaScript frameworks like React and Vue. The complexity of these apps usually makes the separation of frontend and backend applications more reasonable.

The separation of concerns makes synchronization between apps more difficult. Security concerns also arise because of the nature of JavaScript frameworks — they run on the client’s machine.

In this article, I am going to provide a walkthrough of how we can implement authentication for your frontend apps with a .NET Core backend using cookies.

#javascript

Authenticating Frontend Apps Using Cookies in .NET Core Web API
1.40 GEEK