Please join your peers on either March 26 (8pm GMT) or March 28 (8am GMT) to watch as user extraordinaire and forum legend @"lindsay.stevens" demonstrates OpenClinica Insight.
Insight makes it easy to ask questions of ALL of your clinical and operational data and visualize answers via interactive reports and dashboards. The idea is simple, but the results are powerful: ask your questions, choose your visualizations, then return often for updated, interactive results that link you to all of the underlying data.
I'm trying to get all study subject as said here with GET: This is from documentation: {Server_Address}:8080/OpenClinica/rest/clinicaldata/json/view/{Study_Name}/*/*/*
I am getting HTTP 302(found) back, it seems I'm being redirected to OpenClinica/pages/login/login (Location value in response). I am asked to answer oAuth2 challenge - 'Www-Authenticate: OAuth2', not sure what to do next, even more confusing is that in more than a few places in documentation it says api_key is the method used in OC.
the authentication mechanism for existing REST APIs is not harmonised yet (hopefully will be with OC4 on the horisont). RESTful URLs that you are trying to use work with standard user session. You have to emulate user login into OC with POST to OC login and user the stored session for another GET call.
This I have already described in another post on the forum here:
I'm still nowhere with it though since I'm not using curl and localhost:8080/OpenClinica/j_spring_security_check gets me the same 302 response. I added j_username and j_password as POST parameters. (even tried all combinations with/without "j_" )
I'm trying to parse with json using java and filter it according to any field the users will choose.
basically emulates POST with with login form data in MultivaluedMap. After successful login retrieving the jsessionid and creating a cookie. And than later using this cookie to perform authenticated GET for OC Restful URL.
Comments
T
I'm trying to get all study subject as said here with GET:
This is from documentation:
{Server_Address}:8080/OpenClinica/rest/clinicaldata/json/view/{Study_Name}/*/*/*
I am getting HTTP 302(found) back, it seems I'm being redirected to OpenClinica/pages/login/login (Location value in response).
I am asked to answer oAuth2 challenge - 'Www-Authenticate: OAuth2', not sure what to do next, even more confusing is that in more than a few places in documentation it says api_key is the method used in OC.
If anyone can clear this up would be great.
Many thanks
the authentication mechanism for existing REST APIs is not harmonised yet (hopefully will be with OC4 on the horisont). RESTful URLs that you are trying to use work with standard user session. You have to emulate user login into OC with POST to OC login and user the stored session for another GET call.
This I have already described in another post on the forum here:
REST Call to login to OpenClinica
best
T
I'm still nowhere with it though since I'm not using curl and localhost:8080/OpenClinica/j_spring_security_check gets me the same 302 response. I added j_username and j_password as POST parameters.
(even tried all combinations with/without "j_" )
I'm trying to parse with json using java and filter it according to any field the users will choose.
I did manage to run http://openc1.bgu.ac.il/OpenClinica/pages/login/login and get: *I ruined some of that html so that it stays text*
from which I can see the address /OpenClinica/j_spring_security_check you were refering to, with method = post .
Do you know the way for this to wokr correctly?
Many thanks!
it depends on which HTTP client library you are using. If it is jersey have a look at the last getOcRestfulUrl method of the following helper class:
OpenClinicaService.java
basically emulates POST with with login form data in MultivaluedMap. After successful login retrieving the jsessionid and creating a cookie. And than later using this cookie to perform authenticated GET for OC Restful URL.
T