Skip to content

Commit b0f61b2

Browse files
committed
Disable authority validation only for ADFS
1 parent ae2cad2 commit b0f61b2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Registration/RegisterWithAzure.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ function Initialize-AzEnvironment{
3333
$fullUri = $CloudARMEndpoint.TrimEnd('/')+"/metadata/endpoints?api-version=2015-01-01"
3434
$response = Invoke-RestMethod -Uri $fullUri -ErrorAction Stop -UseBasicParsing -TimeoutSec 30 -Verbose
3535
Write-Verbose -Message "Endpoints: $(ConvertTo-Json $response)" -Verbose
36+
$loginEndpoint = $response.authentication.loginEndpoint.TrimEnd('/') + "/"
3637
$endpoints = @{
37-
ActiveDirectoryAuthority = $response.authentication.loginEndpoint.TrimEnd('/') + "/"
38+
ActiveDirectoryAuthority = $loginEndpoint
3839
ActiveDirectoryServiceEndpointResourceId = $response.authentication.audiences[0]
3940
ResourceManagerUrl = $CloudARMEndpoint
4041
GalleryUrl = $response.galleryEndpoint
4142
GraphUrl = $response.graphEndpoint
4243
GraphEndpointResourceId = $response.graphEndpoint
43-
EnableAdfsAuthentication = $true
44+
EnableAdfsAuthentication = $loginEndpoint.EndsWith('/adfs/', [System.StringComparison]::OrdinalIgnoreCase)
4445
}
4546

4647
Remove-AzEnvironment -Name $Name -ErrorAction Ignore | Out-Null

0 commit comments

Comments
 (0)