Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add installation section #3

@avanobberghen

Description

@avanobberghen

Installation:

  1. In the openMEDIS database, make sure that there is an employeeID column in the assests db table, if not then create it.
  2. Copy all the above sources into a folder "api" at the root of openMEDIS
  3. Update the file called config.php, and edit the URL as well as credentials. (They can be found in common.inc.php of openMEDIS)
  4. In api/db folder, run the query mobile_installation_to_extend_existing.sql on the openMEIDS database. This will create fields for key in the login table.

Test it's reachable:

  1. Using Chrome extension "Postman", login to the following POST at http://"domain"/api/public/v1/login, with:
    Headers: select Content type = application/json
    Body: selet "raw", and enter the contents: {"username":"","password":""} (in JSON minified)

  2. open http://ideone.com/ to run the python code

import hashlib
import hmac

def calc_xhash(content, username, password):
	access = "{}{}".format(username, password).encode()
  	pk = hashlib.sha256(access).hexdigest().encode()
  	print(hmac.new(pk, content.encode(), hashlib.sha256).hexdigest())
        
calc_xhash('','<yourusername>', '<yourpassword>')
  1. Test by running this GET: http://"domain"/api/public/v1/database/scheme
    Headers:
    X-PublicKey = [public key from DB login table for your username]
    X-Hash = [result of step 2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions