Independent Component. Client for the Switch Edu-ID Shared Attributes API. Used in Swissbib/Vufind and in Pura Back-End.
use SwitchSharedAttributesAPIClient\SwitchSharedAttributesAPIClient;
$config['auth_user'] = 'username';
$config['auth_password'] = 'password';
$config['base_endpoint_url'] = 'https://test.eduid.ch/sg/index.php'; // or https://eduid.ch/sg/index.php
$switchApi = new SwitchSharedAttributesAPIClient($config);
$userEduId = '[email protected]';
$switchGroupId = 'a4c40594-6d7d-41bc-9fb2-7239d2fcf892';
//add the user to the group
$switchApi->activatePublisherForUser($userEduId, $switchGroupId);
Add this to your composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "[email protected]:swissbib/switchSharedAttributesAPIClient.git"
}
],
"require": {
"swissbib/switchSharedAttributesAPIClient": "dev-master"
}
}
And do composer update
.