Authentication
Angular is the core of Ionic and most of the work with respect to authentication and authorization will be handled in code. There are mainly two ways of implementing server side authentication for frontend applications. You look at the Ionic app as an Angular frontend application. All of what we will cover can be treated as common and can be used on the Web as well as Ionic-based hybrid applications. Mainly there are two ways that we can usually handle authentication:
- Token-based
- Cookie-based
Token based authentication
Token based authentication is a newer approach of authentication in many web applications. In this approach authentication is successful when a user proves the server of their validity by passing the user token, which then is verified by the server. Before getting started with the token-based approach, let's quickly see some benefits of using this approach:
- Stateless
- Mobile-ready
- Performance
- More secure
- Standard based JWT
- There are many other benefits of using the token...