Using Hasura Auth APIs
3.3 Hasura Auth API + Postman Collection | Hasura Internship
Now that we’d set up our app prototype and finished data modelling the next big task at hand was the backend integration.
In computer programming, an APPLICATION PROGRAMMING INTERFACE (API) is a set of subroutine definitions, protocols and tools for building application software. In simpler words, API is a set of clearly defined methods of communication between various software components.
API is testing can be hard but it doesn’t have to be. Postman comes to our rescue and makes it easy to write tests, make sure they are working, set up the testing environment and then eventually hook it all up to build our system.
This document by Hasura provides a very good insight as to how we can use postman to implement our auth API’s.
The following screenshots will show how we implemented some of the very basic concepts for our App.
1.Sign Up
This is when a new user wants to register with us.
The bearer token that has been used here is the same as the token which we get from our console.
2. Login
Once a user has been registered in our database, the following was used to ensure his/ her proper login.
Henceforth, the auth_token that has been generated here will be used as the bearer token to perform other actions such as obtain user information and to logout.
3. User Information
4. Log Out
The data modelling for our app can be found here.
