Skip to content

Commit

Permalink
Merge pull request #1224 from Yvand/Yvand/fix-SPTrustedIdentityTokenI…
Browse files Browse the repository at this point in the history
…ssuer

First run of DSC fails at SPTrustedIdentityTokenIssuer, if property ClaimProviderName is omitted/null/empty
  • Loading branch information
ykuijs authored Jul 28, 2020
2 parents cb73c34 + 67cd97c commit 533c619
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- SPTrustedIdentityTokenIssuer
- Run Get-SPClaimProvider only if property ClaimProviderName is omitted/null/empty.

### Fixed

- SharePointDsc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,15 @@ function Set-TargetResource
throw "SharePoint failed to create the SPTrustedIdentityTokenIssuer."
}

$claimProvider = (Get-SPClaimProvider | Where-Object -FilterScript {
$_.DisplayName -eq $params.ClaimProviderName
})
if ($null -eq $claimProvider)
if ($false -eq [String]::IsNullOrWhiteSpace($params.ClaimProviderName))
{
$trust.ClaimProviderName = $params.ClaimProviderName
$claimProvider = (Get-SPClaimProvider | Where-Object -FilterScript {
$_.DisplayName -eq $params.ClaimProviderName
})
if ($null -eq $claimProvider)
{
$trust.ClaimProviderName = $params.ClaimProviderName
}
}

if ($params.ProviderSignOutUri)
Expand Down

0 comments on commit 533c619

Please sign in to comment.