Hi,
I’m trying to implement the scim protocol in an scim service provider app.
When I add a user, the json I’m posting looks like this:
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"active": true,
"id": "test2",
"userName": "test2",
"emails": [
{
"primary": true,
"value": "tes2t@example.net"
}
],
"displayname": "test2"
}
I used the app “provisionning_api” as a base, and my method looks like this:
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* @param string $id
* @param string $displayName
* @param array $emails
* @param array $groups
* @return DataResponse
* @throws OCSException
*/
public function addUser(string $id,
string $displayname = '',
array $emails = [],
array $groups = [],
array $subadmin = [],
string $quota = '',
string $preferredLanguage = ''): DataResponse {
...
I manage to map all params, but I struggle with the email array part.
How could I access the full json?
Or How could I access the email value with the 'primary': true
?
Thanks for your help!
I looked at this:
It didn’t help me
I’m trying to log to get a sense of what is the object:
$this->logger->error('Log email: ' . array_values($emails)[0], ['app' => 'ocs_api']);
But I get this:
{"reqId":"tGex5C0tsPCTw7uIdVJi","level":3,"time":"2022-04-28T08:54:59+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"ocs_api","method":"POST","url":"/index.php/apps/scimserviceprovider/users","message":"Log email: Array","userAgent":"insomnia/2022.2.1","version":"22.2.7.1"}
Is there a better way to debug? Like a remote debug? Of at least a way to print the full object in the log?
FYI, I’m using the GitHub - juliushaertl/nextcloud-docker-dev: Nextcloud development environment using docker-compose as a dev env for my app dev