Book Image

Learning AngularJS for .NET Developers

By : Alex Pop
Book Image

Learning AngularJS for .NET Developers

By: Alex Pop

Overview of this book

<p>AngularJS is the most popular JavaScript MVC framework, and it embraces and extends HTML rather than abstracting it. The building of single-page applications is a web-designer-friendly process with the AngularJS expressive HTML vocabulary. It drastically reduces the amount of JavaScript required to control complex user interactions and enforces a modular approach to structuring your JavaScript code.</p> <p>This book covers all of the stages of building a single-page web application, starting with frontend components powered by AngularJS, continuing with web services that leverage ServiceStack, and putting it all together in an ASP.NET MVC application. You will learn a development process focused on rapid delivery and testability for all application layers.</p>
Table of Contents (13 chapters)
Learning AngularJS for .NET Developers
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Securing the AngularJS application


We previously discussed that we need to ensure that all browser requests are secured and validated on the server for specific scenarios. Any browser request can be manipulated and changed even unintentionally, so we cannot rely on client-side validation alone.

When discussing securing an AngularJS application, there are a couple of alternatives available, of which I'll mention the following:

  • You can use client-side authentication and employ a web service call to authenticate the current user. You can create a time-limited authentication token that will be passed with each data request. This approach involves additional code in the AngularJS application to handle authentication.

  • You can rely on server-side authentication and use an ASP.NET MVC view that will handle any unauthenticated request. This view will redirect to the view that hosts the AngularJS application only when the authentication is successful. The AngularJS application will implicitly use an...