Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Authentication from OpenMRS:

  1. Create your username and password on your OpenMRS installation. For demo installation see here .
  2. 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 .
  3. The response in case of successful authentication will return a Http OK (200) code with details object. Otherwise response would be Http UNAUTHORIZED (401) code with no data.
  4. The response object 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 user represents complete user details like name, birthdate and other attributes associated, while location represents the area or health facility the worker is responsible for. This is mapped by OpenMRS person attribute location with mapped location uuid.

If you donot want to get user or location details and just need to check whether credentials are valid or not, send http request with parameters "username" and "password" to http://yourServer/security/is-authenticated . For demo http://46.101.51.199:8080/oweb/security/is-authenticated?username=YOURUSER&password=YOURPW .

The response would return with a Http OK code incase of valid credentials and otherwise a Http code UNAUTHORIZED would be returned.

  • No labels