Skip to content

Commit 699788a

Browse files
committed
Fixed single sign on handling for tenant accounts
1 parent edcb9ab commit 699788a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4541,11 +4541,12 @@ function global:Invoke-SgwServerSsoAuthentication {
45414541
Write-Verbose "Retrieving SAML identity provider URI from StorageGRID admin node"
45424542

45434543
if ($Server.AccountId) {
4544-
$Body = "{`"accountId`":`"$($Server.AccountId)`"}"
4544+
$AccountId = $Server.AccountId
45454545
}
45464546
else {
4547-
$Body = "{`"accountId`":`"0`"}"
4547+
$AccountId = 0
45484548
}
4549+
$Body = "{`"accountId`":`"$AccountId`"}"
45494550

45504551
Write-Verbose "Body: $Body"
45514552

@@ -4576,7 +4577,7 @@ function global:Invoke-SgwServerSsoAuthentication {
45764577

45774578
try {
45784579
$Uri = $Server.BaseUri + "/saml-response"
4579-
$Body = "SAMLResponse=" + [System.Net.WebUtility]::UrlEncode($SAMLResponse) + "&RelayState=0"
4580+
$Body = "SAMLResponse=" + [System.Net.WebUtility]::UrlEncode($SAMLResponse) + "&RelayState=" + $AccountId
45804581
$TokenResponse = Invoke-WebRequest -Method POST -Uri $Uri -Session StorageGridSession -ContentType "application/x-www-form-urlencoded" -Body $Body
45814582

45824583
}

0 commit comments

Comments
 (0)