From f1b2c93d5e06aaaea88572b69188025f435fd587 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Jul 2026 22:20:57 +0000 Subject: [PATCH] Merge pull request #100 from CyberDrain/dev Dev to hf Synced from CyberDrain/CIPP@3e2ca0aec08fdd7db1ee12d6a6454b25a63e1812 --- Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1 b/Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1 index 1e247170d8dd0..bb34018f640db 100644 --- a/Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1 +++ b/Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1 @@ -136,7 +136,7 @@ function Test-CIPPAccess { $swUserBranch = [System.Diagnostics.Stopwatch]::StartNew() $User = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Request.Headers.'x-ms-client-principal')) | ConvertFrom-Json - if ($User.claims -and [string]::IsNullOrWhiteSpace($User.userDetails)) { + if ($User.claims -and [string]::IsNullOrWhiteSpace($User.userDetails)) { $Claims = @($User.claims) $Upn = ($Claims | Where-Object { $_.typ -in @('preferred_username', 'upn', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn', 'email', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress') } | Select-Object -First 1).val if ([string]::IsNullOrWhiteSpace($Upn)) { $Upn = $Request.Headers.'x-ms-client-principal-name' } @@ -159,7 +159,7 @@ function Test-CIPPAccess { $swIPCheck = [System.Diagnostics.Stopwatch]::StartNew() if (-not $User.userRoles) { - throw 'Access denied: unable to resolve roles for the authenticated principal, here is what we know about this user: ' + ($User | ConvertTo-Json -Depth 5) + ' and here is what we know about the request: ' + ($Request | ConvertTo-Json -Depth 5) + throw 'Access denied: unable to resolve roles for the authenticated principal' } $AllowedIPRanges = Get-CIPPRoleIPRanges -Roles $User.userRoles