共用方式為


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

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

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

Microsoft Entra ID 可對一或多個 Active Directory 網域發出 Kerberos 票證授權票證 (TGT)。 利用這項功能,使用者可以使用新式認證 (例如 FIDO2 安全性金鑰) 登入 Windows,然後存取傳統的 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 Domain Services 取得 TGT。

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

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

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

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

  4. 用戶端機器會連絡內部部署 Active Directory Domain Controller,並以部分 TGT 換得格式完整的 TGT。

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

必要條件

開始本文中的程序之前,您的組織必須先完成為您的組織啟用通行金鑰 (FIDO2) 中的指示。

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

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

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

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

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

    • Active Directory 使用者,屬於網域的網域管理員群組成員及樹系的企業管理員群組成員。 稱為 $domainCred
    • Microsoft Entra 使用者,屬於全域管理員角色的成員。 稱為 $cloudCred
  • 使用者必須透過 Microsoft Entra Connect 填入下列 Microsoft Entra 屬性:

    • onPremisesSamAccountName (Microsoft Entra Connect 中的 accountName)
    • onPremisesDomainName (Microsoft Entra Connect 中的 domainFQDN)
    • onPremisesSecurityIdentifier (Microsoft Entra Connect 中的 objectSID)

    Microsoft Entra Connect 預設會同步處理這些屬性。 若變更要同步處理的屬性,請務必選取 accountNamedomainFQDNobjectSID 進行同步處理。

支援的案例

本文中的案例支援下列兩個執行個體中的 SSO:

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

不支援的情節

不支援下列案例:

  • 已加入 Windows Server Active Directory Domain Services (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 Connect 解決方案。
  • AzureADHybridAuthenticationManagement 模組是透過 PowerShell 資源庫來散發。 PowerShell 資源庫是 PowerShell 內容的集中存放庫。 您可以在其中找到包含 PowerShell 命令或 Desired State Configuration (DSC) 資源的實用 PowerShell 模組。

建立 Kerberos 伺服器物件

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

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

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

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

根據預設,Set-AzureADKerberosSever Cmdlet 會使用 Commercial 雲端端點。 若要在另一個雲端環境中設定 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 或智慧卡技術,則您必須使用 -UserPrincipalName 參數搭配全域管理員的使用者主體名稱 (UPN)。

  • 以您的內部部署 Active Directory 網域名稱取代下列範例中的 contoso.corp.com
  • 以全域管理員的 UPN 取代下列範例中的 administrator@contoso.onmicrosoft.com
# 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 a 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 或智慧卡技術),則您必須搭配使用 -UserPrincipalName 參數與全域管理員的使用者主體名稱 (UPN)。 而且,您可以略過 "-DomainCredential" 參數。 > - 以全域管理員的 UPN 取代下列範例中的 administrator@contoso.onmicrosoft.com

# 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 a 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 伺服器的屬性。 您可以檢閱這些屬性以確認所有項目的順序正確。

注意

透過以「網域\使用者名稱」格式提供認證來對另一個網域執行,將會透過 NTLM 連線,並且會失敗。 不過,為網域系統管理員使用 userprincipalname 格式,可確保 RPC 繫結至 DC 的嘗試正確使用 Kerberos。 如果使用者位於 Active Directory 的 [受保護的使用者] 安全性群組中,請完成下列步驟來解決此問題:以 ADConnect 中的其他網域使用者登入,但不提供 "-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 伺服器物件在 Microsoft Entra ID 中會以 KerberosDomain 物件表示。 每個內部部署 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 伺服器物件的指示。

已知行為

如果您的密碼已過期,則會封鎖使用 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以檢查您目前的狀態,並確認 AzureAdJoinedDomainJoined 狀態都顯示為 [是]
  • 此同步延遲是已加入網域裝置的已知限制,而且不是 FIDO 特有的。

如果我在使用 FIDO 登入之後無法以單一登入來登入 NTLM 網路資源,並且出現認證提示,該怎麼辦?

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

注意

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

FIDO2 安全性金鑰是否適用於混合式環境中具有 RODC 的 Windows 登入?

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

下一步

深入了解無密碼驗證