Hasura Auth API + Postman collection

Hasura Auth API + Postman collection 



This link talk about Hasura Data API+ Postman Collection

1) Login Query:
To login use http://auth.c101.hasura.me/login URL


Snapshot of login query in Postman is
 Response to login query is
 {
       "hasura_roles":[
                 "user"
       ],
        "auth_token":"gv31vbfgfgfgfgec002hqhzr2gfgg0ey",
       "hasura_id":2
}

When a user logs in, a new session token is created for the user. It is set as cookie and also returned in auth_token of the response. In the above example, the session token is gv31vbfgfgfgfgec002hqhzr2gfgg0ey. The token and the associated user’s information is stored in the session store.

2) User Info: Used http://auth.c101.hasura.me/user/account/info URL to get user information. Session token has to be copied in Authorization header. If the Authorization header is absent, session token is read from cookie. The response of account info query is as below:

{
       "hasura_roles":[
                 "user"
       ],
        "auth_token":"gv31vbfgfgfgfgec002hqhzr2gfgg0ey",
         "username": "danny",
       "hasura_id":2
       "email":null,
       "mobile":null
}

3) Logout:

GET http://auth.c101.hasura.me/user/logout HTTP/1.1 
Authorization: Bearer gv31vbfgfgfgfgec002hqhzr2gfgg0ey

Output
  
{
"message": "Logged out"



 
 

Comments

Popular posts from this blog

Three Screen App Idea

Week 8 - Final App

Setup dev environment