Merge pull request #121 from Cloud-Architekt/master

Changed behavior for AT with wrong audience
This commit is contained in:
Nestori Syynimaa
2025-09-30 21:30:24 +03:00
committed by GitHub
+3 -7
View File
@@ -104,14 +104,10 @@ function Get-AccessTokenFromCache
if((($tAudience -ne $tResource) -and ($Script:RESIDs[$tAudience] -ne $tResource)) -and ($Force -eq $False))
{
# Wrong audience
Write-Verbose "ACCESS TOKEN HAS WRONG AUDIENCE: $tAudience. Exptected: $tResource."
Throw "The audience of the access token ($tAudience) is wrong. Should be $tResource!"
}
else
{
# Just return the passed access token
$retVal=$AccessToken
Write-Warning "The audience of the access token ($tAudience) is wrong. Should be $tResource!"
}
# Just return the passed access token
$retVal=$AccessToken
}
# Check the expiration