diff --git a/src/WebAPI/OData/Client.php b/src/WebAPI/OData/Client.php index b5ebf271..8d07b349 100644 --- a/src/WebAPI/OData/Client.php +++ b/src/WebAPI/OData/Client.php @@ -194,8 +194,11 @@ private function doRequest( string $method, string $url, $data = null, array $he $headers = array_merge( [ 'Content-Type' => 'application/json' ], $headers ); } - if ( $this->settings->callerID !== null ) { - $headers = array_merge( [ 'MSCRMCallerID' => '$this->settings->callerID' ], $headers ); + if ( $this->settings->callerObjectId !== null ) { + $headers = array_merge( [ 'CallerObjectId' => $this->settings->callerObjectId ], $headers ); + } + elseif ( $this->settings->callerID !== null ) { + $headers = array_merge( [ 'MSCRMCallerID' => $this->settings->callerID ], $headers ); } try { diff --git a/src/WebAPI/OData/Settings.php b/src/WebAPI/OData/Settings.php index 1fe5dd6b..73c8ed96 100644 --- a/src/WebAPI/OData/Settings.php +++ b/src/WebAPI/OData/Settings.php @@ -75,12 +75,19 @@ abstract class Settings implements LoggerAwareInterface { public LoggerInterface $logger; /** - * ID of the user to impersonate during calls. - * + * ID of the user (systemuserid) to impersonate during calls. + * @deprecated * Null value means impersonation is not performed. */ public ?string $callerID = null; + /** + * Microsoft Entra ID object ID - azureactivedirectoryobjectid + * + * Null value means impersonation is not performed. + */ + public ?string $callerObjectId = null; + /** * Settings constructor. */