Angular UI Router is the de-facto solution for single page applications and
flexible routing in angular. It has many useful features such as nested views and states that can help us write clean code.
A careful consideration on how we structure our application in nested states/views, and a thoughtful process of designing and structuring the state tree, can help us achieve a solid design and a clean architecture for our application.
We are going to see a brief example on how to use the nested states feature to implement an elegant solution for the security of an application.
I am going to show how to wrap the OAuth callback flow with an Angular promise, and how that will help create a clean and maintainable code.
HTTP protocol specified only two standard authentication mechanisms, which are implemented in every browser, the HTTP basic authentication, and the Digest authentication which is obsolete now because it is not secure anymore.
Because they are limited and work only on user name/password idea, the development communities in every web development platform came up with their better customized solutions.
JWT is one of the most promising and smart authentication ideas that is taking famous recently.