AngularJS clientside routing and token authentication with webapi
I want to create an example for authentication and authorization in an SPA angularjs application using asp.net mvc webapi as the backend and client side routing (no cshtml). Below is just example of functions that can be used to set up the complete example. But I just can´t put it all togehter. Any help appreciated. Questions: What is best practise: Cookie or Token based? How do I create the bearer token in angular to authorize on each request? Validation on API functions? How do I preserve the autentication signed in user on the client? Example code: Sign in form <form name="form" novalidate>