Versions Compared

Key

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

...

Send http request with parameters "username" and "password" to http://yourServer/security/authenticate. For demo http://46.101.51.199:8080/oweb/security/authenticate?username=YOURUSER&password=YOURPW . The response would be a json document with two objects mappable to "user" and "location" of org.opensrp.api.domain.User and org.opensrp.api.domain.Location respectively. The location is one the health worker is mapped to via OpenMRS person attribute "location".

 

{
    "location": {
        "creator": null,
        "dateCreated": null,
        "editor": null,
        "dateEdited": null,
        "voided": false,
        "dateVoided": null,
        "voider": null,
        "voidReason": null,
        "locationId": "cd4ed528-87cd-42ee-a175-5e7089521ebd",
        "name": "testloc",
        "address": null,
        "identifiers": null,
        "parentLocation": null,
        "tags": null,
        "attributes": null
    },
    "user": {
        "creator": null,
        "dateCreated": null,
        "editor": null,
        "dateEdited": null,
        "voided": false,
        "dateVoided": null,
        "voider": null,
        "voidReason": null,
        "username": "admin",
        "password": null,
        "salt": null,
        "status": null,
        "roles": [
            "Provider",
            "System Developer"
        ],
        "permissions": null,
        "baseEntityId": "baa5c5d3-cebe-11e4-9a12-040144de7001",
        "baseEntity": {
            "creator": null,
            "dateCreated": null,
            "editor": null,
            "dateEdited": null,
            "voided": false,
            "dateVoided": null,
            "voider": null,
            "voidReason": null,
            "id": "baa5c5d3-cebe-11e4-9a12-040144de7001",
            "firstName": "Super User",
            "middleName": "",
            "lastName": "",
            "birthdate": null,
            "deathdate": null,
            "birthdateApprox": null,
            "deathdateApprox": null,
            "gender": "M",
            "addresses": null,
            "attributes": {
                "Location": "cd4ed528-87cd-42ee-a175-5e7089521ebd",
                "Health Center": "2"
            }
        },
        "defaultAdmin": false
    }
}