OpenFn / adaptors

The new home for OpenFn adaptors; re-usable connectors for the most common DPGs and DPI building blocks.
GNU General Public License v3.0
7 stars 8 forks source link

`openLMIS` Add OAuth support and generic helpers (get, post, put) #670

Closed mtuchi closed 2 months ago

mtuchi commented 3 months ago

Description

To start, this adaptor should handle authentication via OAuth and support the following operation

Demo Server Credentials: URL: https://demo-v3.openlmis.org/#!/home username: administrator password: password

OpenLMIS API requests are authenticated by an OAuth2 access token passed as a query parameter. See a sample API request below:

GET /api/reports/templates/requisitions/{id}?access_token=
9a556033-ed13-4dde-9561-158469d15134

URI Parameters
id: required (string)

Query Parameters
access_token: required (string)
OAuth2 access token

Link to test OAuth2 token here: https://github.com/OpenLMIS/openlmis-auth/blob/master/src/main/resources/db/demo-data/auth.api_keys.csv

mtuchi commented 2 months ago

@christad92 i get the access_token and also i can't login to the https://demo-v3.openlmis.org/#!/home with the given credential

mtuchi commented 2 months ago

API documentations

mtuchi commented 2 months ago

I have made good progress on this issue, See #675 But i am missing unit test which i think it's crucial to have I have skipped the unit test for now but i will implement them before requesting review from Joe

josephjclark commented 2 months ago

@mtuchi I can't log into the demo server either - any tips?

josephjclark commented 2 months ago

@mtuchi Aha, it works if I log in https://test.openlmis.org and not demo-v3

mtuchi commented 2 months ago

Ooh yeah @josephjclark i was testing using https://test.openlmis.org i forgotten to update the issue 🤦🏽. Since the adaptor is already released can we close this issue now ?