Active Directory 同盟服務 prompt=login 參數支援

下列文件說明 AD FS 中可用的 prompt=login 參數的原生支援。

什麼是 prompt=login?

當應用程式需要向 Microsoft Entra ID 要求全新驗證時,表示它們需要 Microsoft Entra ID 重新驗證使用者,即使使用者已經過驗證也一樣,它們可以將 prompt=login 參數傳送到 Microsoft Entra ID,作為驗證要求的一部分。

當此要求是針對同盟使用者時,Microsoft Entra ID 需要通知 IdP (如 AD FS),指明該要求是用於全新驗證。

預設情況下,當傳送此類驗證要求給同盟 IdP 時,Microsoft Entra ID 會將 prompt=login 轉換為 wfresh=0wauth=https://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password

這些參數的意義如下:

  • wfresh=0:執行新的驗證
  • wauth=https://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password:對新驗證要求使用「使用者名稱/密碼」

這可能會導致公司內部網路和多重要素驗證發生問題 (如果需要使用者名稱和密碼以外的驗證類型的話;如 wauth 參數所要求)。

具有 2016 年 7 月更新彙總套件的 Windows Server 2012 R2 中的 AD FS 導入了 prompt=login 參數的原生支援。 這意味著現在 Microsoft Entra ID 可以將此參數依原樣作為 Microsoft Entra ID 和 Office 365 驗證要求的一部分傳送到 AD FS 服務。

支援 prompt=login 的 AD FS 版本

以下列出支援 prompt=login 參數的 AD FS 版本。

  • 具有 2016 年 7 月更新彙總套件的 Windows Server 2012 R2 中的 AD FS
  • Windows Server 2016 或更新版本中的 AD FS

如何設定同盟網域以將 prompt=login 傳送至 AD FS

使用 Microsoft Graph PowerShell 模組來配置設定。

  1. 首先請執行下列 PowerShell 命令,以取得 FederatedIdpMfaBehaviorPreferredAuthenticationProtocolPromptLoginBehavior 目前的值:

    Get-MgDomainFederationConfiguration -DomainId <your_domain_name> | Format-List *
    

    注意

    根據預設,Get-MgDomainFederationConfiguration 的輸出不會在主控台中顯示特定屬性。 若要檢視所有屬性,您應該使用管線 (|) 將其輸出傳送至 Format-List *,以強制輸出物件的所有屬性。

    如果屬性 PromptLoginBehavior 的值是空的 ($null),則會使用 TranslateToFreshPasswordAuth 的行為。

  2. 執行下列命令,以設定 PromptLoginBehavior 所需的值:

    New-MgDomainFederationConfiguration -DomainId <your_domain_name> `
       -FederatedIdpMfaBehavior <current_value_from_step1> `
       -PreferredAuthenticationProtocol <current_value_from_step1> `
       -PromptLoginBehavior <TranslateToFreshPasswordAuth|NativeSupport|Disabled>
    

以下是 PromptLoginBehavior 參數可能的值及其意義:

  • TranslateToFreshPasswordAuth:表示將 prompt=login 轉換為 wauth=https://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/passwordwfresh=0 的預設 Microsoft Entra 行為。
  • NativeSupport:表示 prompt=login 參數會按現況傳送至 AD FS。 若您的 AD FS 屬於具有 2016 年 7 月更新彙總套件或更新版本的 Windows Server 2012 R2,則建議使用此值。
  • 停用:表示只會將 wfresh=0 傳送至 AD FS。