From 478c65f9075bec4e8fa48e2597e3662af090cf31 Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Tue, 31 Aug 2021 16:05:59 +0200 Subject: [PATCH] Fixes #1238 --- CHANGELOG.md | 2 ++ .../MSFT_SPTrustedIdentityTokenIssuer.psm1 | 4 ++-- .../SharePointDsc.SPTrustedIdentityTokenIssuer.Tests.ps1 | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f18d9ed..88342f0a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SPSite - Implemented workaround to prevent issue with creating site collections immediately after farm creation (Error "Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e}") +- SPTrustedIdentityTokenIssuer + - Fixed issue where the IdentifierClaim was not properly detected in the Set method - SPWorkManagementServiceApp - Updated links to Docs instead of old TechNet diff --git a/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 b/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 index ede9a23ee..7a7098b44 100644 --- a/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPTrustedIdentityTokenIssuer/MSFT_SPTrustedIdentityTokenIssuer.psm1 @@ -76,7 +76,7 @@ function Get-TargetResource $description = $spTrust.Description $realm = $spTrust.DefaultProviderRealm $signInUrl = $spTrust.ProviderUri.OriginalString - $identifierClaim = $spTrust.IdentityClaimTypeInformation.MappedClaimType + $identifierClaim = $spTrust.IdentityClaimTypeInformation.InputClaimType $SigningCertificateThumbprint = $spTrust.SigningCertificate.Thumbprint $currentState = "Present" $claimProviderName = $sptrust.ClaimProviderName @@ -299,7 +299,7 @@ function Set-TargetResource } $mappings = ($claimsMappingsArray | Where-Object -FilterScript { - $_.MappedClaimType -like $params.IdentifierClaim + $_.InputClaimType -like $params.IdentifierClaim }) if ($null -eq $mappings) { diff --git a/tests/Unit/SharePointDsc/SharePointDsc.SPTrustedIdentityTokenIssuer.Tests.ps1 b/tests/Unit/SharePointDsc/SharePointDsc.SPTrustedIdentityTokenIssuer.Tests.ps1 index b8b9e389f..693c41dc0 100644 --- a/tests/Unit/SharePointDsc/SharePointDsc.SPTrustedIdentityTokenIssuer.Tests.ps1 +++ b/tests/Unit/SharePointDsc/SharePointDsc.SPTrustedIdentityTokenIssuer.Tests.ps1 @@ -50,7 +50,7 @@ try InModuleScope -ModuleName $script:DSCResourceFullName -ScriptBlock { Describe -Name $Global:SPDscHelper.DescribeHeader -Fixture { BeforeAll { - Invoke-Command -Scriptblock $Global:SPDscHelper.InitializeScript -NoNewScope + Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope # Mocks for all contexts Mock -CommandName Get-ChildItem -MockWith { @@ -73,7 +73,7 @@ try Mock -CommandName New-SPClaimTypeMapping -MockWith { return [pscustomobject]@{ - MappedClaimType = $testParams.IdentifierClaim + InputClaimType = $testParams.IdentifierClaim } } @@ -543,7 +543,7 @@ try Mock -CommandName New-SPClaimTypeMapping -MockWith { return [pscustomobject]@{ - MappedClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" + InputClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" } } }