There is an example filter script called Azure Cross Tenant User Group Filter Example (Global Script #1427) that calls Get-ImmyAzureAuthHeader as a filter script but it does not run properly in that context. It runs fine in the Immy System context as a cloud script. I wrote a similar filterscript calling Get-ImmyAzureAuthHeader that works properly in the Immy System context but will not work as a filterscript. I cannot find anything in the documentation or in the community that explains the difference between a filterscript versus an immy system type running as a cloud script.
I supported a support ticket asking about this 3 weeks ago to figure out if it is a bug or intended to work this way and have not received a response.