Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Authentication & Authorization

...

  1. Login using IdP API

 

         POST http://<IdP-URL>/api/1.0/sso/signin

with headers:

  • client_id = (client id of the user representing the organization)
  • X-Auth-Token = (Secret API Token given to the user representing the Organization)

...

Info

{

   "error": true,

   "message": "Not authenticated",

   "code": 401

}

 

  1. Logout using IdP API 
    POST http://<IdP-URL>/api/1.0/sso/signout/{access_token}   

    with headers:

      
      • client_id = (client id of the user representing the organization)
      • X-Auth-Token = (Secret API Token given to the user representing the Organization)
      

    with form-data (content-type :application/x-www-form-urlencoded)

      
      • email
      • password
     
  2. Get user info from access token
    GET http://<IdP-URL>/api/1.0/sso/token/{access_token}

  3.  Accessing a service/resource provider
    As explained earlier, once an "access_token" is received, you may call other HIE APIs. All API calls must accompany the following details.
    with headers: 
      • client_id = (client id of the user representing the organization)
      • X-Auth-Token = (access token fetched earlier)
      • from = (email id of the requester, one thats used for login)


...

For example: the following userinfo may be returned to the service provider, when they try to identify the requester (example, someone is trying to create/POST a patient). Note the profiles associated. 

Code Block
{
    "id": 6,
    "name": “Dr. I.K.Rohan” X Y Z”,
    "email": "rohanik@gmailxyz@gmail.com",
    "is_active" : true,    
    "activated": true,
    "activated_at": null,
    "last_login": "2015-01-20 09:52:58",
    "access_token": "xyz_token",
    "created_at": "2014-09-04 13:26:14",
    "updated_at": "2015-01-20 09:52:58",
    "deleted_at": null,
    "groups": ["MCI Admin", "API Consumer"], 
    "profiles": [
      { 
         type: "provider",
         id: "123",
         catchment: ["302618","302614"]
      },
      {
         type: "admin",
         id: "2",
         catchment: ["3026"]
      }, 
      {
         type: "facility",
         id: "10000069",
         catchment: ["302618"]
      },
      {
         type: "patient",
         id: "10091232131",
         catchment: []
      }
    ]    
}

...