Skip to content

Commit 74af1f6

Browse files
committed
Fixed issues with Single Sign On
1 parent b8ef3cd commit 74af1f6

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,8 +4534,6 @@ function global:Disconnect-SgwServer {
45344534
A System.Management.Automation.PSCredential object containing the credentials needed to log into the StorageGRID admin node.
45354535
.PARAMETER SkipCertificateCheck
45364536
If the StorageGRID admin node certificate cannot be verified, the connection will fail. Specify -SkipCertificateCheck to skip the validation of the StorageGRID admin node certificate.
4537-
.PARAMETER AccountId
4538-
Account ID of the StorageGRID tenant to connect to.
45394537
#>
45404538
function global:Invoke-SgwServerSsoAuthentication {
45414539
[CmdletBinding()]
@@ -4573,7 +4571,12 @@ function global:Invoke-SgwServerSsoAuthentication {
45734571

45744572
Write-Verbose "Retrieving SAML identity provider URI from StorageGRID admin node"
45754573

4576-
$Body = '{"accountId":"$AccountId"}'
4574+
if ($Server.AccountId) {
4575+
$Body = "{`"accountId`":`"$($Server.AccountId)`"}"
4576+
}
4577+
else {
4578+
$Body = "{`"accountId`":`"0`"}"
4579+
}
45774580

45784581
Write-Verbose "Body: $Body"
45794582

@@ -4603,8 +4606,9 @@ function global:Invoke-SgwServerSsoAuthentication {
46034606
Write-Verbose "Retrieve StorageGRID token using SAML Response"
46044607

46054608
try {
4609+
$Uri = $Server.BaseUri + "/saml-response"
46064610
$Body = "SAMLResponse=" + [System.Net.WebUtility]::UrlEncode($SAMLResponse) + "&RelayState=0"
4607-
$TokenResponse = Invoke-WebRequest -Method POST -Uri "https://cbc-sg-beta.muccbc.hq.netapp.com/api/saml-response" -Session StorageGridSession -ContentType "application/x-www-form-urlencoded" -Body $Body
4611+
$TokenResponse = Invoke-WebRequest -Method POST -Uri $Uri -Session StorageGridSession -ContentType "application/x-www-form-urlencoded" -Body $Body
46084612

46094613
}
46104614
catch {

0 commit comments

Comments
 (0)