徵狀
請試想下列案例:
-
您在 Microsoft SharePoint Server 2013 web 應用程式中使用 Windows 理賠驗證(透過 Windows 質詢/回應 [NTLM] 或 Kerberos)。
-
您決定使用安全的應用程式標記語言(SAML)的提供者(例如 Active Directory Federation Services (AD FS)),來切換到受信任的提供者宣告。
-
您可以在 Microsoft 開發人員網路(MSDN)網站上,查看 SharePoint Server 2013 主題中的 Windows 理賠驗證遷移 的步驟。
-
您執行下列命令:
Convert-SPWebApplication-識別碼 $wa--可信賴-從宣告-WINDOWS-TrustedProvider $tp-SourceSkipList $csv-RetainPermissions
在此案例中,您收到下列錯誤訊息:
無法相容 SAML 聲明驗證。
原因
發生這個問題的原因是,不是使用預設設定建立信任身分識別權杖頒發者。 [ 轉換-SPWebApplication ] 命令必須使用預設設定才能正常運作。 Convert-SPWebApplication 命令需要受信任提供者的特定設定,才能與從 Windows 聲明轉換為 SAML 或相反的轉換相容。具體說來,您必須使用 UseDefaultConfiguration 和 IdentifierClaimIs 參數來建立信任身分識別權杖頒發者。您可以執行下列 Windows PowerShell 腳本,以檢查您的信任身分識別權杖頒發者是否已使用 UseDefaultConfiguration 參數建立。注意: 這些腳本假設您只有一個在目前的伺服器陣列中建立信任的身分識別提供者。
$tp = Get-SPTrustedIdentityTokenIssuer$tp.claimtypes
此腳本應該輸出的宣告類型如下所示:
-
http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname
-
http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid
-
http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid
-
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
-
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn
#Get the Identity claim:$tp = Get-SPTrustedIdentityTokenIssuer$tp.IdentityClaimTypeInformation
身分識別聲明必須是下列其中一項:
-
WindowAccountName
-
EmailAddress
-
UPN
$Tp 輸出範例。IdentityClaimTypeInformation: DisplayName: Email InputClaimType: Http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressMappedClaimType: HTTP://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress#IsIdentityClaim : True 應該有一個自訂的宣告提供者與權杖頒發者的名稱相同,而且應該是 type SPTrustedBackedByActiveDirectoryClaimProvider。執行此操作以查看宣告提供者是否存在且相容性:
$tp = Get-SPTrustedIdentityTokenIssuer$name = $tp.name$cp = Get-SPClaimProvider $nameif($cp.typename -match "SPTrustedBackedByActiveDirectoryClaimProvider"){write-host "Claim provider is present and has TypeName of " $cp.typename " it should be valid"}else{write-host "Claim provider is not present. Trusted Identity Token Issuer" $tp.name " is not compatible with convert-spwebapplication"}
解決方案
若要解決此問題,請刪除並重新建立信任的身分識別權杖頒發者。 若要執行這項操作,請依照下列步驟執行:
-
執行下列腳本:
$tp = Get-SPTrustedIdentityTokenIssuer$tp | fl$tp.name$tp.IdentityClaimTypeInformation
製作此腳本的輸出複本,以供日後參考。 具體說來,我們需要 Name 屬性的值,才能使用相同的名稱建立新的權杖頒發者,而且我們需要身分識別宣告,才能使用相同的身分識別宣告建立新的宣告提供者。 只要針對權杖頒發者使用相同的名稱,且使用相同的宣告作為身分識別宣告,所有使用者在重新建立權杖頒發者之後,就會在 web 應用程式中維持他們的許可權。
-
從驗證提供者移除目前正在使用它的任何 web 應用程式的目前信任身分識別提供者。
-
執行下列命令以刪除權杖頒發者:
Remove-SPTrustedIdentityTokenIssuer -Identity "TheNameOfYourTokenIssuer"
-
重新建立權杖頒發者。 若要這樣做,請依照 Microsoft TechNet 網站上的 SharePoint Server 2013 主題中的 [ 實施 SAML 驗證 ] 主題中的步驟操作,以取得詳細資訊。重要 當您執行 新的-SPTrustedIdentityTokenIssuer 命令時,您必須使用 UseDefaultConfiguration 和 IdentifierClaimIs 參數。 UseDefaultConfiguration參數只是一個參數。 IdentifierClaimIs參數的可能值如下所示:
-
帳戶名稱
-
電子郵件
-
使用者主要-名稱
範例腳本:
$ap = New-SPTrustedIdentityTokenIssuer -Name $tokenIdentityProviderName -Description $TrustedIdentityTokenIssuerDescription -realm $siteRealm -ImportTrustCertificate $adfsCert-SignInUrl $signInUrl -UseDefaultConfiguration -IdentifierClaimIs EMAIL -RegisteredIssuerName $siteRealm
-
-
在 [管理中心] 中,將您要轉換的 web 應用程式的新信任身分識別標記寄件者新增到驗證提供者。 Web 應用程式必須 同時 具備 Windows 驗證和目標信任身分識別提供者。
其他相關資訊
成功轉換的其他秘訣:如果將電子郵件值用於識別碼宣告(也就是IdentifierClaimIs參數),只會轉換那些其電子郵件地址已填入 Active Directory 的使用者。在 SourceSkipList 參數中定義的 .csv 檔案中所列的任何使用者帳戶,都不會轉換成 SAML。 若要從 Windows 聲明轉換成 SAML,使用者帳戶名稱可以使用或不含宣告符號列出。 例如,"contoso\user1" 或 "i:0 #. w | contoso\user1" 是可以接受的。 您應該將任何您不想要轉換的使用者帳戶新增到該 .csv 檔案。 這些應該包括服務帳戶和系統管理員帳戶。