1. Go to this page and download the library: Download edu-sharing/auth-plugin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
edu-sharing / auth-plugin example snippets
use EduSharingApiClient\EduSharingNodeHelper;
use EduSharingApiClient\SignatureHandler;
class MySignatureHandler implements SignatureHandler
{
private EduSharingNodeHelper $nodeHelper;
public function __construct(EduSharingNodeHelper $nodeHelper) {
$this->nodeHelper = $nodeHelper;
}
public function getAlgorithm(): string {
try {
$about = $this->nodeHelper->base->getAbout();
if (isset($about['defaultSignatureAlgorithm'])) {
return $about['defaultSignatureAlgorithm'];
}
} catch (Exception) {
// Do nothing. Just use default
}
return $this->nodeHelper->base->defaultAlgorithm;
}
}
$base->registerCurlHandler(new class extends CurlHandler {
public function handleCurlRequest(string $url, array $curlOptions): CurlResult
{
return new CurlResult('', 0, []);
}
});