i am in the dashboard my $user is me
when i invoke-udendpoint the $identity inside it is 'system'
i have to funny things like add a header with $user in to override the wrong identity
the role system should handle my identity through the entire system without me having to work around everything
Hello Matthew,
Thank you for the clear description. I tested this on PowerShell Universal 2026.3.4 and found a related problem, though not the "System" identity itself.
An app endpoint started with Invoke-UDEndpoint had no $ClaimsPrincipal and no $Roles, while the same button clicked directly had both. Adding -Session did not change that. $User still held my user name there. I could not reproduce your "System", so I cannot yet say whether it has the same cause. I am passing the claims and roles result to our development team as a bug and will let you know here what comes of it.
In the meantime there are two limited options, neither tested against your "System" path.
1. If you use Invoke-UDEndpoint to share code between handlers, put that code in a function at the top of your app file, outside New-UDApp, and call the function directly from the handler. In our test the function ran with the user, claims and roles of the click that called it.
2. If the invoked endpoint only needs the user name, set a session variable (https://docs.devolutions.net/powershell-universal/apps/custom-variable-scopes/#session-scope) just before the call and read it back there as $Session:LabUser, as in our test. It does not bring back the claims or roles, and session variables stay inside the app, so it cannot replace a header sent to an API endpoint. This is the line we ran.
$Session:LabUser = $User
Which version of PowerShell Universal are you running? Could you also share the lines that read $Identity and show where "System" appears, including any call to an API endpoint or a script? With those I can test your exact path. If you would rather not post them here, you can send them by forum private message or to service@devolutions.net with case number 136114.
Best regards,
Michel
Michel Audi
ya so for me to get around it, i have been adding a header for X-PSU-User-OVERRIDE = "username" to bypass it, i hate it.
does this help?
"Api": {
"SecurityModel": "Integrated",
so some things i need to pass the identity to. maybe if invoke-udendpoint had -Claims $claims and -Identity $user or something like that where you could send the object down when you wanted. thus allow endpoints to run as the system and endpoints to run as the user
yes & ./path/to/endpoint/get-something.ps1 -parms $x does work, its a shame i cannot use the internal stuff without friction.
Hello Matthew,
Thank you, that helps, and I am glad that calling the script directly with & works for you. That matches our test, where a function called from the handler kept the user, claims and roles.
I am adding your -Claims and -Identity suggestion for Invoke-UDEndpoint to the report with our development team. In 2026.3.4 the cmdlet takes only -Id, -Session and -Wait. I will let you know here what comes of it.
On "System", I tested your Integrated model on 2026.3.2 and 2026.3.4, from an app button clicked directly and through Invoke-UDEndpoint. With Invoke-PSUEndpoint, an API endpoint with authentication saw my signed-in user as $Identity, with my role, without your header. Invoke-RestMethod did the same only with an app token granted to my user, and got 401 without one. A job started with Invoke-PSUScript was recorded under my user, although $Identity inside the script was empty. None of these showed "System". This is the Invoke-PSUEndpoint line we ran.
Invoke-PSUEndpoint -Url '/lab/who' -Method 'GET'
To find where your "System" comes from, I need two things.
1. Your PowerShell Universal version.
2. The line that sends your X-PSU-User-OVERRIDE header, without any token or password value, the definition of the API endpoint or script it calls, with its authentication and role, and the line where you read $Identity and see "System".
If you would rather not post them here, you can send them by forum private message or to service@devolutions.net with case number 136114.
Best regards,
Michel
Michel Audi