使用 Microsoft Entra ID 啟用無密碼安全性密鑰登入內部部署資源

本主題說明如何使用執行 Windows 10 版本 2004 或更新版本的裝置,為內部部署資源啟用無密碼驗證。 裝置可以是已加入 Microsoft Entra 或 Microsoft Entra 混合式聯結 當您使用 Microsoft 相容的安全性金鑰,或使用 Windows Hello 企業版 Cloud 信任時,此無密碼驗證功能可為內部部署資源提供順暢的單一登錄(SSO)。

使用 SSO 以使用 FIDO2 金鑰登入內部部署資源

Microsoft Entra ID 可以為一或多個 Active Directory 網域發出 Kerberos 票證授與票證(TGT)。 透過這項功能,使用者可以使用新式認證登入 Windows,例如 FIDO2 安全性密鑰,然後存取傳統 Active Directory 型資源。 Kerberos 服務票證和授權會繼續由您的 內部部署的 Active Directory 域控制器 (DC) 控制。

Microsoft Entra Kerberos 伺服器物件會在您的 內部部署的 Active Directory 實例中建立,然後安全地發佈至 Microsoft Entra ID。 物件未與任何實體伺服器相關聯。 這隻是 Microsoft Entra ID 可用來為您的 Active Directory 網域產生 Kerberos TGT 的資源。

顯示如何從 Microsoft Entra ID 和 Active Directory 網域服務 取得 TGT 的圖表。

  1. 使用者使用 FIDO2 安全性金鑰登入 Windows 10 裝置,並向 Microsoft Entra 識別碼進行驗證。

  2. Microsoft Entra ID 會檢查目錄是否有符合使用者 內部部署的 Active Directory 網域的 Kerberos 伺服器密鑰。

    Microsoft Entra ID 會為使用者的 內部部署的 Active Directory 網域產生 Kerberos TGT。 TGT 僅包含使用者的 SID,且沒有授權數據。

  3. TGT 會連同使用者的 Microsoft Entra 主要重新整理令牌 (PRT) 一起傳回用戶端。

  4. 用戶端計算機會連絡 內部部署的 Active Directory 域控制器,並交易完整格式 TGT 的部分 TGT。

  5. 用戶端計算機現在有 Microsoft Entra PRT 和完整的 Active Directory TGT,而且可以存取雲端和內部部署資源。

必要條件

開始本文中的程式之前,您的組織必須完成啟用 Windows 10 裝置無密碼安全性密鑰登入中的指示。

您也必須符合下列系統需求:

  • 裝置必須執行 Windows 10 2004 版或更新版本。

  • 您的 Windows Server 域控制器必須執行 Windows Server 2016 或更新版本,並已安裝下列伺服器的修補程式:

  • 當網路安全性時,必須啟用AES256_HMAC_SHA1:在域控制器上設定 Kerberos 原則允許的加密類型。

  • 請具備完成案例中步驟所需的認證:

    • Active Directory 使用者,其為網域的 Domain 管理員 s 群組成員,以及樹系之 Enterprise 管理員 s 群組的成員。 稱為 $domainCred
    • Microsoft Entra 使用者,其為 Global 管理員 istrators 角色的成員。 稱為 $cloudCred
  • 用戶必須透過 Microsoft Entra 連線 填入下列 Microsoft Entra ID 屬性:

    • onPremisesSamAccountName (Entra 中的 accountName 連線)
    • onPremisesDomainName (Entra 連線 中的 domainFQDN)
    • onPremisesSecurityIdentifier (Entra 連線 中的 objectSID)

    Entra 連線 預設會同步處理這些屬性。 如果您變更要同步處理的屬性,請選取 accountName、domainFQDN 和 objectSID 進行同步處理。

支援的案例

本文中的案例支援下列兩個實例中的 SSO:

  • 雲端資源,例如 Microsoft 365 和其他啟用安全性聲明標記語言 (SAML) 的應用程式。
  • 內部部署資源,以及網站與 Windows 整合式驗證。 這些資源可以包含需要 IIS 驗證的網站和 SharePoint 網站,以及/或使用 NTLM 驗證的資源。

不支援的情節

不支援下列案例:

  • 已加入 Windows Server Active Directory 網域服務 (AD DS)的部署(僅限內部部署裝置)。
  • 使用安全性金鑰的遠端桌面通訊協定 (RDP)、虛擬桌面基礎結構 (VDI) 和 Citrix 案例。
  • 使用安全性金鑰進行 S/MIME。
  • 使用安全性金鑰執行身 分。
  • 使用安全性金鑰登入伺服器。

AzureADHybridAuthenticationManagement安裝模組

AzureADHybridAuthenticationManagement 模組 會為系統管理員提供 FIDO2 管理功能。

  1. 使用 [以系統管理員身分執行] 選項開啟 PowerShell 提示字元。

  2. 安裝模組 AzureADHybridAuthenticationManagement

    # First, ensure TLS 1.2 for PowerShell gallery access.
    [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
    
    # Install the AzureADHybridAuthenticationManagement PowerShell module.
    Install-Module -Name AzureADHybridAuthenticationManagement -AllowClobber
    

注意

  • AzureADHybridAuthenticationManagement 模組使用 AzureADPreview PowerShell 模組 來提供進階的 Microsoft Entra 管理功能。 如果本機計算機上已安裝 Azure Active Directory PowerShell 模組,此處所述的安裝可能會因為衝突而失敗。 若要防止安裝期間發生任何衝突,請務必包含 “-AllowClobber” 選項旗標。
  • 您可以在可存取 內部部署的 Active Directory 域控制器的任何計算機上安裝AzureADHybridAuthenticationManagement模組,而不需依賴 Microsoft Entra 連線 解決方案。
  • 模組AzureADHybridAuthenticationManagement會透過 PowerShell 資源庫 散發。 PowerShell 資源庫 是 PowerShell 內容的中央存放庫。 您可以在其中找到實用的 PowerShell 模組,其中包含 PowerShell 命令和 Desired 狀態設定 (DSC) 資源。

建立 Kerberos Server 物件

管理員 istrators 會使用AzureADHybridAuthenticationManagement模組在其內部部署目錄中建立 Microsoft Entra Kerberos 伺服器物件。

在您的組織中包含 Microsoft Entra 使用者的每個網域和樹系中執行下列步驟:

  1. 使用 [以系統管理員身分執行] 選項開啟 PowerShell 提示字元。
  2. 執行下列 PowerShell 命令,以在 內部部署的 Active Directory 網域和 Microsoft Entra 租使用者中建立新的 Microsoft Entra Kerberos 伺服器物件。

選取 [Azure 雲端] (預設值為 Azure Commercial)

根據預設, Set-AzureADKerberosSever Cmdlet 會使用商業雲端端點。 如果您要在另一個雲端環境中設定 Kerberos,則必須將 Cmdlet 設定為使用指定的雲端。

若要取得 可用雲端的清單 ,以及變更所需的數值,請執行下列命令:
Get-AzureADKerberosServerEndpoint

範例輸出:

Current Endpoint = 0(Public)
Supported Endpoints:
   0 :Public
   1 :China
   2 :Us Government

記下 所需雲端環境旁的數值

若要接著 設定 所需的雲端環境,請執行下列命令:
(例如:美國政府雲端)
Set-AzureADKerberosServerEndpoint -TargetEndpoint 2

範例 1 提示輸入所有認證

# Specify the on-premises Active Directory domain. A new Azure AD
# Kerberos Server object will be created in this Active Directory domain.
$domain = $env:USERDNSDOMAIN

# Enter an Azure Active Directory global administrator username and password.
$cloudCred = Get-Credential -Message 'An Active Directory user who is a member of the Global Administrators group for Azure AD.'

# Enter a domain administrator username and password.
$domainCred = Get-Credential -Message 'An Active Directory user who is a member of the Domain Admins group.'

# Create the new Azure AD Kerberos Server object in Active Directory
# and then publish it to Azure Active Directory.
Set-AzureADKerberosServer -Domain $domain -CloudCredential $cloudCred -DomainCredential $domainCred

雲端認證的範例 2 提示字元

注意

如果您正在使用具有網域系統管理員許可權的帳戶來使用已加入網域的計算機,您可以略過 “-DomainCredential” 參數。 如果未提供 「-DomainCredential」 參數,則會使用目前的 Windows 登入認證來存取您的 內部部署的 Active Directory 域控制器。

# Specify the on-premises Active Directory domain. A new Azure AD
# Kerberos Server object will be created in this Active Directory domain.
$domain = $env:USERDNSDOMAIN

# Enter an Azure Active Directory global administrator username and password.
$cloudCred = Get-Credential

# Create the new Azure AD Kerberos Server object in Active Directory
# and then publish it to Azure Active Directory.
# Use the current windows login credential to access the on-premises AD.
Set-AzureADKerberosServer -Domain $domain -CloudCredential $cloudCred

範例 3 提示使用新式驗證的所有認證

注意

如果您的組織保護密碼型登入,並強制執行新式驗證方法,例如多重要素驗證、FIDO2 或智慧卡技術,您必須搭配全域管理員的用戶主體名稱 (UPN) 使用 -UserPrincipalName 參數。

  • 以您的 內部部署的 Active Directory 網域名稱取代contoso.corp.com下列範例中的 。
  • 將下列範例中的 取代 administrator@contoso.onmicrosoft.com 為全域管理員的 UPN。
# Specify the on-premises Active Directory domain. A new Azure AD
# Kerberos Server object will be created in this Active Directory domain.
$domain = $env:USERDNSDOMAIN

# Enter a UPN of an Azure Active Directory global administrator
$userPrincipalName = "administrator@contoso.onmicrosoft.com"

# Enter a domain administrator username and password.
$domainCred = Get-Credential

# Create the new Azure AD Kerberos Server object in Active Directory
# and then publish it to Azure Active Directory.
# Open an interactive sign-in prompt with given username to access the Azure AD.
Set-AzureADKerberosServer -Domain $domain -UserPrincipalName $userPrincipalName -DomainCredential $domainCred

範例 4 提示使用新式驗證的雲端認證

注意

如果您正在使用具有網域系統管理員許可權的帳戶,且您的組織使用網域系統管理員許可權的帳戶,並強制執行新式驗證方法,例如多重要素驗證、FIDO2 或智慧卡技術,您必須搭配全域管理員的用戶主體名稱 (UPN) 使用 -UserPrincipalName 參數。 您可以略過 「-DomainCredential」 參數。 > - 將下列範例中的 取代 administrator@contoso.onmicrosoft.com 為全域管理員的 UPN。

# Specify the on-premises Active Directory domain. A new Azure AD
# Kerberos Server object will be created in this Active Directory domain.
$domain = $env:USERDNSDOMAIN

# Enter a UPN of an Azure Active Directory global administrator
$userPrincipalName = "administrator@contoso.onmicrosoft.com"

# Create the new Azure AD Kerberos Server object in Active Directory
# and then publish it to Azure Active Directory.
# Open an interactive sign-in prompt with given username to access the Azure AD.
Set-AzureADKerberosServer -Domain $domain -UserPrincipalName $userPrincipalName

檢視及驗證 Microsoft Entra Kerberos 伺服器

您可以使用下列命令來檢視和驗證新建立的 Microsoft Entra Kerberos 伺服器:

 # When prompted to provide domain credentials use the userprincipalname format for the username instead of domain\username
Get-AzureADKerberosServer -Domain $domain -UserPrincipalName $userPrincipalName -DomainCredential (get-credential)

此命令會輸出 Microsoft Entra Kerberos 伺服器的屬性。 您可以檢閱屬性,以確認所有專案都井然有序。

注意

藉由提供 domain\username 格式的認證,針對另一個網域執行,將會透過 NTLM 連線,然後失敗。 不過,針對網域系統管理員使用userprincipalname格式可確保 RPC 系結至 DC 的嘗試正確使用 Kerberos。 如果使用者位於 Active Directory 中的受保護使用者安全組中,請完成下列步驟來解決此問題:以 AD 中的另一個網域使用者身分登入 連線 且未提供 “-domainCredential”。 使用目前登入之使用者的 Kerberos 票證。 您可以藉由執行 whoami /groups 來驗證使用者是否具有 Active Directory 中的必要許可權來執行上述命令來確認。

屬性 說明
識別碼 AD DS DC 物件的唯一標識符。 此標識碼有時稱為其 位置 或其 分支標識碼
DomainDnsName Active Directory 網域的 DNS 功能變數名稱。
ComputerAccount Microsoft Entra Kerberos 伺服器對象的電腦帳戶物件(DC)。
UserAccount 保留 Microsoft Entra Kerberos 伺服器 TGT 加密密鑰的停用使用者帳戶物件。 此帳戶的網域名稱 CN=krbtgt_AzureAD,CN=Users,<Domain-DN>
KeyVersion Microsoft Entra Kerberos 伺服器 TGT 加密密鑰的金鑰版本。 建立金鑰時會指派版本。 每次輪替金鑰時,版本就會遞增。 增量是以復寫元數據為基礎,而且可能大於一個。 例如,初始 KeyVersion 可以 192272。 第一次輪替密鑰時,版本可能會前進到 212621。 請務必確認 內部部署物件的 KeyVersion雲端物件的 CloudKeyVersion 相同。
KeyUpdatedOn Microsoft Entra Kerberos 伺服器 TGT 加密密鑰更新或建立的日期和時間。
KeyUpdatedFrom 上次更新 Microsoft Entra Kerberos 伺服器 TGT 加密金鑰的 DC。
CloudId Microsoft Entra 對象的標識碼。 必須符合數據表第一行的標識碼。
CloudDomainDnsName Microsoft Entra 物件的 DomainDnsName。 必須符合 數據表第二行的 DomainDnsName
CloudKeyVersion 來自 Microsoft Entra 物件的 KeyVersion。 必須符合 數據表第五行的 KeyVersion
CloudKeyUpdatedOn 來自 Microsoft Entra 物件的 KeyUpdatedOn。 必須符合 數據表第六行的 KeyUpdatedOn

輪替 Microsoft Entra Kerberos 伺服器密鑰

Microsoft Entra Kerberos 伺服器加密 krbtgt 金鑰應該定期輪替。 建議您遵循用來輪替所有其他 Active Directory DC krbtgt 金鑰的相同排程。

警告

還有其他工具可以輪替 krbtgt 鍵。 不過,您必須使用本檔中所述的工具來輪替 Microsoft Entra Kerberos 伺服器的 krbtgt 金鑰。 這可確保金鑰會在 內部部署的 Active Directory 和 Microsoft Entra ID 中更新。

Set-AzureADKerberosServer -Domain $domain -CloudCredential $cloudCred -DomainCredential $domainCred -RotateServerKey

拿掉 Microsoft Entra Kerberos 伺服器

如果您想要還原案例,並從 內部部署的 Active Directory 和 Microsoft Entra ID 中移除 Microsoft Entra Kerberos 伺服器,請執行下列命令:

Remove-AzureADKerberosServer -Domain $domain -CloudCredential $cloudCred -DomainCredential $domainCred

多林和多域案例

Microsoft Entra Kerberos 伺服器物件是以 KerberosDomain 物件表示在 Microsoft Entra ID 中。 每個 內部部署的 Active Directory 網域都會以 Microsoft Entra ID 中的單一 KerberosDomain 物件表示。

例如,假設您的組織具有具有兩個網域 contoso.comfabrikam.com的 Active Directory 樹系。 如果您選擇允許 Microsoft Entra ID 針對整個樹系發出 Kerberos TGT,則 Microsoft Entra ID 中有兩個 KerberosDomain 物件、一個 KerberosDomain 物件contoso.com,另一個用於 fabrikam.com。 如果您有多個 Active Directory 樹系,則每個樹系中的每個網域都有一個 KerberosDomain 物件。

依照在組織中包含 Microsoft Entra 使用者的每個網域和樹系中建立 Kerberos Server 物件中的指示操作。

已知行為

如果您的密碼已過期,則會封鎖使用 FIDO 登入。 預期用戶必須先重設其密碼,才能使用 FIDO 登入。 此行為也適用於混合式內部部署同步使用者使用 Windows Hello 企業版 雲端 kerberos 信任登入。

疑難解答和意見反應

如果您遇到問題或想要分享此無密碼安全性金鑰登入功能的意見反應,請執行下列動作,透過 Windows 意見反應中樞 應用程式共用:

  1. 開啟 意見反應中樞,並確定您已登入。
  2. 選取下列類別來提交意見反應:
    • 類別:安全性和隱私權
    • 子類別:FIDO
  3. 若要擷取記錄,請使用 [ 重新建立我的問題] 選項。

無密碼安全性金鑰登入常見問題

提示

本文中的步驟可能會根據您從開始的入口網站稍有不同。

以下是關於無密碼登入常見問題的一些解答:

無密碼安全性金鑰登入是否在內部部署環境中運作?

此功能無法在純內部部署AD DS環境中運作。

我的組織需要雙因素驗證才能存取資源。 我該怎麼做才能支援這項需求?

安全性金鑰具有各種尺寸。 請連絡記錄的裝置製造商,討論其裝置如何以 PIN 或生物特徵辨識作為第二個因素來啟用。

系統管理員是否可以設定安全性密鑰?

我們正致力於此功能的正式推出 (GA) 版本此功能。

哪裡可以找到符合規範的安全性密鑰?

如需相容安全性密鑰的相關信息,請參閱 FIDO2 安全性密鑰

如果我遺失安全性密鑰,該怎麼辦?

若要刪除已註冊的安全性密鑰,請登入 myaccount.microsoft.com,然後移至 [安全性資訊 ] 頁面。

如果我無法在建立 Microsoft Entra 混合式聯結計算機之後立即使用 FIDO 安全性密鑰,該怎麼辦?

如果您要清除安裝已加入網域的 Microsoft Entra 混合式電腦,請在加入網域並重新啟動程序之後,您必須使用密碼登入,並等候原則同步,才能使用 FIDO 安全性密鑰登入。

  • 在 [命令提示字元] 視窗中執行dsregcmd /status來檢查您目前的狀態,並檢查以確定 AzureAdJoined 和 DomainJoined 狀態都顯示為 [是]。
  • 這項同步處理延遲是已加入網域的裝置已知限制,並非 FIDO 特定。

如果我使用 FIDO 登入並取得認證提示之後,無法單一登錄 NTLM 網路資源,該怎麼辦?

請確定已修補足夠的 DC,以及時回應您的資源要求。 若要查看DC是否正在執行此功能,請執行 nltest /dsgetdc:contoso /keylist /kdc,然後檢閱輸出。

注意

/keylist命令中的nltest參數可在用戶端 Windows 10 v2004 和更新版本中取得。

FIDO2 安全性金鑰是否在混合式環境中具有 RODC 的 Windows 登入中運作?

FIDO2 Windows 登入會尋找可寫入的 DC 來交換使用者 TGT。 只要每個網站至少有一個可寫入DC,登入就會正常運作。

下一步

深入瞭解無密碼驗證