使用同盟移轉至 Microsoft Entra 多重要素驗證

將多重要素驗證 (MFA) 解決方案移至 Microsoft Entra ID 是雲端旅程中絕佳的第一個步驟。 也請考慮在未來移至 Microsoft Entra ID 以進行用戶驗證。 如需詳細資訊,請參閱使用雲端驗證移轉至 Microsoft Entra 多重要素驗證的程式。

若要使用同盟移轉至 Microsoft Entra 多重要素驗證,Microsoft Entra 多重要素驗證提供者會安裝在 AD FS 上。 Microsoft Entra ID 信賴憑證者信任和其他信賴憑證者信任已設定為針對已移轉的使用者使用 Microsoft Entra 多重要素驗證。

下圖顯示移轉程式。

Flow chart of the migration process. Process areas and headings in this document are in the same order

建立移轉群組

若要建立新的條件式存取原則,您必須將這些原則指派給群組。 您可以針對此目的使用 Microsoft Entra 安全組或 Microsoft 365 群組。 您也可以建立或同步新專案。

您也需要 Microsoft Entra 安全組,才能反覆將使用者遷移至 Microsoft Entra 多重要素驗證。 這些群組會用於宣告規則中。

請勿重複使用用於安全性的群組。 如果您使用安全組來保護具有條件式存取原則的高價值應用程式群組,請只針對該目的使用群組。

準備 AD FS

將AD FS 伺服器陣列升級至 2019,FBL 4

在AD FS 2019 中,您可以指定信賴憑證者的其他驗證方法,例如應用程式。 您可以使用群組成員資格來判斷驗證提供者。 藉由指定其他驗證方法,您可以轉換至 Microsoft Entra 多重要素驗證,同時讓其他驗證在轉換期間保持不變。 如需詳細資訊,請參閱 使用WID資料庫升級至 Windows Server 2016 中的 AD FS。 本文涵蓋將伺服器陣列升級至AD FS 2019,並將 FBL 升級至4。

設定宣告規則以叫用 Microsoft Entra 多重要素驗證

現在,Microsoft Entra 多重要素驗證是額外的驗證方法,您可以指派使用者群組來使用它。 您可以藉由設定宣告規則,也稱為信賴憑證者信任來執行此動作。 藉由使用群組,您可以控制全域或應用程式所呼叫的驗證提供者。 例如,您可以針對已註冊合併安全性資訊的使用者呼叫 Microsoft Entra 多重要素驗證,同時針對尚未註冊的使用者呼叫 MFA Server。

注意

宣告規則需要內部部署安全組。 對宣告規則進行變更之前,請先備份這些規則。

備份規則

設定新的宣告規則之前,請先備份您的規則。 您必須在清除步驟中還原這些規則。

視您的組態而定,您可能也需要複製規則,並附加為移轉建立的新規則。

若要檢視全域規則,請執行:

Get-AdfsAdditionalAuthenticationRule

若要檢視信賴憑證者信任,請執行下列命令,並將 RPTrustName 取代為信賴憑證者信任宣告規則的名稱:

(Get-AdfsRelyingPartyTrust -Name "RPTrustName").AdditionalAuthenticationRules 

訪問控制原則

注意

無法設定訪問控制原則,因此會根據群組成員資格叫用特定的驗證提供者。

若要從訪問控制原則轉換為其他驗證規則,請使用 MFA Server 驗證提供者,針對每個信賴憑證者信任執行下列命令:

Set-AdfsRelyingPartyTrust -TargetName AppA -AccessControlPolicyName $Null

此命令會將邏輯從您目前的 存取控制 原則移至其他驗證規則。

設定群組,並尋找 SID

您必須有一個特定群組,在其中放置您要叫用 Microsoft Entra 多重要素驗證的使用者。 您需要該群組的安全性識別碼 (SID)。

若要尋找群組 SID,請使用下列命令搭配您的組名

Get-ADGroup "GroupName"

Image of screen shot showing the results of the Get-ADGroup script.

設定宣告規則以呼叫 Microsoft Entra 多重要素驗證

下列 PowerShell Cmdlet 會在不在公司網路上時,為群組中的使用者叫用 Microsoft Entra 多重要素驗證。 執行上述 Cmdlet,將 「YourGroupSid」 取代為找到的 SID。

請務必在 2019 年檢閱如何選擇其他驗證提供者。

重要

備份您的宣告規則

設定全域宣告規則

執行下列 PowerShell cmdlet:

(Get-AdfsRelyingPartyTrust -Name "RPTrustName").AdditionalAuthenticationRules

此命令會傳回您信賴憑證者信任的目前其他驗證規則。 將下列規則附加至您目前的宣告規則:

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value == 
"YourGroupSID"] => issue(Type = "http://schemas.microsoft.com/claims/authnmethodsproviders", 
Value = "AzureMfaAuthentication");
not exists([Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", 
Value=="YourGroupSid"]) => issue(Type = 
"http://schemas.microsoft.com/claims/authnmethodsproviders", Value = 
"AzureMfaServerAuthentication");'

下列範例假設您目前的宣告規則已設定為在使用者從網路外部連線時提示 MFA。 此範例包含您需要附加的其他規則。

Set-AdfsAdditionalAuthenticationRule -AdditionalAuthenticationRules 'c:[type == 
"http://schemas.microsoft.com/ws/2012/01/insidecorporatenetwork", value == "false"] => issue(type = 
"http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod", value = 
"http://schemas.microsoft.com/claims/multipleauthn" );
 c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value == 
"YourGroupSID"] => issue(Type = "http://schemas.microsoft.com/claims/authnmethodsproviders", 
Value = "AzureMfaAuthentication");
not exists([Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", 
Value=="YourGroupSid"]) => issue(Type = 
"http://schemas.microsoft.com/claims/authnmethodsproviders", Value = 
"AzureMfaServerAuthentication");'

設定個別應用程式宣告規則

此範例會修改特定信賴憑證者信任的宣告規則(應用程式),並包含您必須附加的資訊。

Set-AdfsRelyingPartyTrust -TargetName AppA -AdditionalAuthenticationRules 'c:[type == 
"http://schemas.microsoft.com/ws/2012/01/insidecorporatenetwork", value == "false"] => issue(type = 
"http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod", value = 
"http://schemas.microsoft.com/claims/multipleauthn" );
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value == 
"YourGroupSID"] => issue(Type = "http://schemas.microsoft.com/claims/authnmethodsproviders", 
Value = "AzureMfaAuthentication");
not exists([Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", 
Value=="YourGroupSid"]) => issue(Type = 
"http://schemas.microsoft.com/claims/authnmethodsproviders", Value = 
"AzureMfaServerAuthentication");'

在AD FS中將 Microsoft Entra 多重要素驗證設定為驗證提供者

若要設定 AD FS 的 Microsoft Entra 多重要素驗證,您必須設定每個 AD FS 伺服器。 如果您的伺服器陣列中有多個 AD FS 伺服器,您可以使用 Azure AD PowerShell 從遠端設定它們。

如需此程式的逐步指示,請參閱使用AD FS設定 Microsoft Entra 多重要素驗證作為驗證提供者一文中的設定AD FS 伺服器。

設定伺服器之後,您可以將 Microsoft Entra 多重要素驗證新增為額外的驗證方法。

Screen shot showing the Edit authentication methods screen with Microsoft Entra multifactor authentication and Azure Multi-Factor Authentication Server selected

準備 Microsoft Entra 識別碼並實作移轉

本節涵蓋移轉使用者 MFA 設定之前的最後步驟。

將 federatedIdpMfaBehavior 設定為 enforceMfaByFederatedIdp

針對同盟網域,MFA 可由 Microsoft Entra 條件式存取或內部部署同盟提供者強制執行。 每個同盟網域都有名為 federatedIdpMfaBehavior 的 Microsoft Graph PowerShell 安全性設定。 您可以將 federatedIdpMfaBehavior 設定enforceMfaByFederatedIdp ,讓 Microsoft Entra ID 接受由同盟識別提供者執行的 MFA。 如果同盟識別提供者未執行 MFA,Microsoft Entra ID 會將要求重新導向至同盟識別提供者以執行 MFA。 如需詳細資訊,請參閱 federatedIdpMfaBehavior

注意

federatedIdpMfaBehavior 設定是 New-MgDomainFederationConfiguration Cmdlet 的 SupportsMfa 属性新版本

針對設定 SupportsMfa 屬性的網域,這些規則會決定 federatedIdpMfaBehaviorSupportsMfa 如何一起運作:

  • 不支援在 federatedIdpMfaBehaviorSupportsMfa 之間切換。
  • 設定 federatedIdpMfaBehavior 屬性之後,Microsoft Entra ID 會忽略 SupportsMfa 設定。
  • 如果未設定 federatedIdpMfaBehavior 屬性,Microsoft Entra ID 會繼續接受 SupportsMfa 設定。
  • 如果未 設定 federatedIdpMfaBehaviorSupportsMfa,Microsoft Entra ID 會預設為 acceptIfMfaDoneByFederatedIdp 行為。

您可以使用 Get-MgDomainFederationConfiguration 來檢查 federatedIdpMfaBehavior 的狀態

Get-MgDomainFederationConfiguration –DomainID yourdomain.com

您也可以使用 Get-MgDomainFederationConfiguration 檢查 SupportsMfa 旗標的狀態

Get-MgDomainFederationConfiguration –DomainName yourdomain.com

下列範例示範如何使用 Graph PowerShell 將 federatedIdpMfaBehavior 設定enforceMfaByFederatedIdp

要求

PATCH https://graph.microsoft.com/beta/domains/contoso.com/federationConfiguration/6601d14b-d113-8f64-fda2-9b5ddda18ecc
Content-Type: application/json
{
  "federatedIdpMfaBehavior": "enforceMfaByFederatedIdp"
}

回應

注意: 此處顯示的回應物件可能會縮短以取得可讀性。

HTTP/1.1 200 OK
Content-Type: application/json
{
  "@odata.type": "#microsoft.graph.internalDomainFederation",
  "id": "6601d14b-d113-8f64-fda2-9b5ddda18ecc",
   "issuerUri": "http://contoso.com/adfs/services/trust",
   "metadataExchangeUri": "https://sts.contoso.com/adfs/services/trust/mex",
   "signingCertificate": "MIIE3jCCAsagAwIBAgIQQcyDaZz3MI",
   "passiveSignInUri": "https://sts.contoso.com/adfs/ls",
   "preferredAuthenticationProtocol": "wsFed",
   "activeSignInUri": "https://sts.contoso.com/adfs/services/trust/2005/usernamemixed",
   "signOutUri": "https://sts.contoso.com/adfs/ls",
   "promptLoginBehavior": "nativeSupport",
   "isSignedAuthenticationRequestRequired": true,
   "nextSigningCertificate": "MIIE3jCCAsagAwIBAgIQQcyDaZz3MI",
   "signingCertificateUpdateStatus": {
        "certificateUpdateResult": "Success",
        "lastRunDateTime": "2021-08-25T07:44:46.2616778Z"
    },
   "federatedIdpMfaBehavior": "enforceMfaByFederatedIdp"
}

視需要設定條件式存取原則

如果您使用條件式存取來判斷何時提示使用者輸入 MFA,就不應該變更原則。

如果您的同盟網域已將 SupportsMfa 設定為 false,請分析 Microsoft Entra ID 信賴憑證者信任的宣告規則,並建立支援相同安全性目標的條件式存取原則。

建立條件式存取原則以強制執行與 AD FS 相同的控件之後,您可以在 Microsoft Entra ID 信賴憑證者上備份和移除宣告規則自定義。

如需詳細資訊,請參閱以下資源:

註冊 Microsoft Entra 多重要素驗證的使用者

本節涵蓋使用者如何註冊合併的安全性(MFA 和自助式密碼重設),以及如何移轉其 MFA 設定。 Microsoft Authenticator 可以當做無密碼模式使用。 它也可以作為 MFA 的第二個因素,搭配任一註冊方法使用。

建議您讓使用者註冊合併的安全性資訊,這是註冊 MFA 和 SSPR 驗證方法和裝置的單一位置。

Microsoft 提供通訊範本,您可以提供給使用者,以引導他們完成合併的註冊程式。 其中包括電子郵件、海報、表格帳篷和其他各種資產的範本。 使用者會在 https://aka.ms/mysecurityinfo註冊其資訊,這會帶他們前往合併的安全性註冊畫面。

我們建議您 使用條件式存取來保護安全性註冊程式,而條件式存取 需要從信任的裝置或位置進行註冊。 如需追蹤註冊狀態的資訊,請參閱 Microsoft Entra ID 的驗證方法活動。

注意

必須從非信任位置或裝置註冊其合併安全性信息的使用者,可以發出暫時存取通行證,或者暫時從原則中排除。

從 MFA 伺服器移轉 MFA 設定

您可以使用 MFA Server 移轉公用程式 ,將使用者的已註冊 MFA 設定從 MFA Server 同步處理至 Microsoft Entra ID。 您可以同步處理電話號碼、硬體令牌和裝置註冊,例如 Microsoft Authenticator 設定。

將使用者新增至適當的群組

  • 如果您已建立新的條件式存取原則,請將適當的使用者新增至這些群組。

  • 如果您為宣告規則建立內部部署安全組,請將適當的使用者新增至這些群組。

我們不建議您重複使用用於安全性的群組。 如果您使用安全組來保護具有條件式存取原則的高價值應用程式群組,請只針對該目的使用群組。

監視

您可以使用驗證方法使用方式和深入解析報告來監視 Microsoft Entra 多重要素驗證註冊。 此報告可在 Microsoft Entra 識別碼中找到。 選取 [ 監視],然後選取 [ 使用量與深入解析]。

在 [使用方式與深入解析] 中,選取 [ 驗證方法]。

您可以在 [註冊] 索引標籤上找到詳細的 Microsoft Entra 多重要素驗證註冊資訊。您可以藉由選取 能夠使用 Azure 多重要素驗證 超連結的使用者,向下切入以檢視已註冊的用戶清單。

Image of Authentication methods activity screen showing user registrations to MFA

清除步驟

完成移轉至 Microsoft Entra 多重要素驗證並準備好解除委任 MFA Server 之後,請執行下列三件事:

  1. 將AD FS上的宣告規則還原為其移轉前設定,並移除MFA Server驗證提供者。

  2. 將 MFA 伺服器移除為 AD FS 中的驗證提供者。 這可確保所有使用者都使用 Microsoft Entra 多重要素驗證,因為它是唯一啟用的其他驗證方法。

  3. 解除委任 MFA 伺服器。

還原 AD FS 上的宣告規則,並移除 MFA Server 驗證提供者

遵循設定宣告規則以叫用 Microsoft Entra 多重要素驗證底下的步驟,還原回備份的宣告規則,並移除任何 AzureMFAServerAuthentication 宣告規則。

例如,從規則中移除下列專案:

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value ==
"**YourGroupSID**"] => issue(Type = "http://schemas.microsoft.com/claims/authnmethodsproviders",
Value = "AzureMfaAuthentication");
not exists([Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value=="YourGroupSid"]) => issue(Type =
"http://schemas.microsoft.com/claims/authnmethodsproviders", Value =
"AzureMfaServerAuthentication");'

停用 MFA Server 作為 AD FS 中的驗證提供者

這項變更可確保僅使用 Microsoft Entra 多重要素驗證作為驗證提供者。

  1. 開啟AD FS管理主控台

  2. 在 [服務] 底下,以滑鼠右鍵按兩下 [驗證方法],然後選取 [編輯多重要素驗證方法]。

  3. 取消核取 Azure Multi-Factor Authentication Server 旁的方塊。

解除委任 MFA 伺服器

遵循您的企業伺服器解除委任程式,以移除您環境中的 MFA 伺服器。

解除委任 MFA 伺服器時的可能考慮包括:

  • 在移除伺服器之前,請先檢閱 MFA Server 的記錄,以確保沒有任何使用者或應用程式使用它。

  • 從伺服器上的 控制台 卸載 Multi-Factor Authentication Server

  • 選擇性地清除備份後留下的記錄和數據目錄。

  • 如果適用的話,請卸載多重要素驗證 Web Server SDK,包括 etpub\wwwroot\MultiFactorAuthWebServiceSdk 和 或 MultiFactorAuth 目錄中剩餘的任何檔案

  • 針對 8.0 之前的 MFA Server 版本,可能需要移除 App Web Service 電話 多重要素驗證

後續步驟