I'm trying for long time to initiate a GET request to retrieve JSON from Opencast server. From the official website authentication mechanism that was mentioned is Basic Auth, but after searing around I found that Digest Auth is the one that is used for the API which was mentioned on:
I have been trying to connect to the API, but no results till now. I used cUrl and httpful, but it always give an error HTTP/1.1 401 An Authentication object was not found in the SecurityContext.
I used cUrl with php same issue, and example that is given on https://opencast.jira.com/wiki/display/MH/Remote+Services is not working at all:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url.$uri);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Requested-Auth: Digest"));
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Opencast-Matterhorn-Authorization: true"));
$response = curl_exec($ch);
May someone tell me what is the right auth mechanism used to connect to Opencast API and how I can connect to? all trails didn't success.